Evenset interview question

Algorithm and Logic Question