VacuumLabs interview question

they asked one difficult algorithm question