Google Interview Question

They asked non linear dsa question