Valeo Interview Question

It was C problem solving