Lhasa interview question

Problem solving algorithm that was too basic