Water Management

  • 1

    There are N tubs of water, numbered from 1 to N. Initially there is a few litres of water in each tub. Each water tub has 2

    taps attached to it. Incoming Tap with speed x litres / second and Outgoing Tap with speed y litres / second.

    Let water(i) denote the final volume of water in ith tube

    Amit wants to attain such a situation that water(i) < water(i+1) for 1<=i <=N. i.e. water in each tub must be less than

    water in the tub next to it. He wants to do this as quickly as possible.

    You task is to find out and tell Amit, what is the minimum number of seconds required to attain in this situation.

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.