Bending Spoons Interview Question

The problems are each containing sub problems