VacuumLabs Interview Question

They asked an algorithm question