Lead Devops Engineer Interview Questions

10,618 lead devops engineer interview questions shared by candidates

Maximum Tree Height : Harry has n glasses of water. There is an array arr of n positive integers which represents the amount of water (in litres) in the ith glass. By watering X litres of water to a tree with height H, the height of the tree will increase by X units only if amount of water is more than the height of tree otherwise tree will soak the water and its height will not increase. Your task is to help Harry to water the tree with initial height 0 using n glasses of water in any order to maximize the height of the tree and return the maximum possible height of the tree. Note: One glass can be used only once, and you can't mix water of multiple glasses in one glass. Input Specification: input1: An integer n representing the available number of water glasses. input2: An integer array arr representing the amount of water in the ith glass. Output Specification: Return an integer value representing the maximum possible height of the tree.
avatar

Devops Engineer

Interviewed at Mitsogo

3.7
Oct 27, 2023

Maximum Tree Height : Harry has n glasses of water. There is an array arr of n positive integers which represents the amount of water (in litres) in the ith glass. By watering X litres of water to a tree with height H, the height of the tree will increase by X units only if amount of water is more than the height of tree otherwise tree will soak the water and its height will not increase. Your task is to help Harry to water the tree with initial height 0 using n glasses of water in any order to maximize the height of the tree and return the maximum possible height of the tree. Note: One glass can be used only once, and you can't mix water of multiple glasses in one glass. Input Specification: input1: An integer n representing the available number of water glasses. input2: An integer array arr representing the amount of water in the ith glass. Output Specification: Return an integer value representing the maximum possible height of the tree.

Viewing 9831 - 9840 interview questions

Glassdoor has 10,618 interview questions and reports from Lead devops engineer interviews. Prepare for your interview. Get hired. Love your job.