What does map do ?
Answer: It creates a new array with the results of calling a function on every element in the calling array.
(Question source : hackerrank)
You have three stacks of cylinders where each cylinder has the same diameter, but they may vary in height. You can change the height of a stack by removing and discarding its topmost cylinder any number of times.