Company: Phonepe_4july
Difficulty: medium
Lets Levelize It Problem Description There are n jugs standing on the floor, numbered 1, 2, ..., n. Jug i currently holds water up to height h[i] units. You want every jug to end up holding water at exactly the same height. You work hour by hour, starting at hour 1. During hour j you may do exactly one of two things: Fill one jug. Choose a single jug and raise its water level. The amount added depends only on the hour number: it is 1 unit if j is odd (1, 3, 5, 7, ...) and 2 units if j is even (2, 4, 6, 8, ...). Skip the hour. Do nothing at all. You may never fill more than one jug in the same hour, and water is never removed from a jug - levels only go up. Determine the minimum number of hours needed until all n jugs hold water at the same height. The answer is the number of the last hour in which you fill a jug; hours skipped after that point do not count. (inferred - the source states the process starts at hour 1 and asks for the minimum number of hours; trailing skipped hours are th