ABC interview question

Problem solving questions in 2nd round