Company: Bounteous × Accolite_15oct
Difficulty: medium
Water Fountain Problem Description You are on a family vacation, visiting a circular ring road that has n water fountains numbered 0 to n - 1 in clockwise order. Fountain i holds water[i] droplets of water. Walking clockwise from fountain i to the next fountain (i + 1) % n costs cost[i] droplets. You carry one bottle. It starts empty, it has no capacity limit, and whenever you stand at a fountain you immediately collect all water[i] droplets there. You may begin at any fountain you like. A trip is successful if, starting with the empty bottle at some fountain and walking clockwise, you return to that same fountain having visited every fountain exactly once, without the bottle ever being short of the droplets a walk requires. Find the smallest index of a fountain you can start from so that the full clockwise circuit succeeds. If no starting fountain works, return -1 . Input Format The first line contains a single integer n , the number of fountains. The second line contains n space-sepa