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.
You can also visualize this by thinking that a[p] denotes the starting point of an uprising in value and a[q+1] denotes the end point. In this case, traverse through the array is like climbing a mountain, and the sum we keep denotes the elevation.
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 →
You can also visualize this by thinking that
a[p]
denotes the starting point of an uprising in value anda[q+1]
denotes the end point. In this case, traverse through the array is like climbing a mountain, and the sum we keep denotes the elevation.