Bending Spoons Interview Question

To solve a logical task.