We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
We can imagine this solution as a climbing many mountains and finding the tallest mountain by climbing where more energy is needed to climb than downclimb. We need to sum height at every level of a mountain while only climbing. And in real we don't need to add while downclimbing(that is subtracted) till next mountain arrives. Real life problems are related to such problems. It may be the old technique to calculate heights of mountains.
If you want to visualize as I say then create a bar chart for the A of the nxn solution.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Array Manipulation
You are viewing a single comment's thread. Return to all comments →
We can imagine this solution as a climbing many mountains and finding the tallest mountain by climbing where more energy is needed to climb than downclimb. We need to sum height at every level of a mountain while only climbing. And in real we don't need to add while downclimbing(that is subtracted) till next mountain arrives. Real life problems are related to such problems. It may be the old technique to calculate heights of mountains. If you want to visualize as I say then create a bar chart for the A of the nxn solution.