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.
It's not clear to me from this array how to calculate the accumulated slope. Obviously the answer is 10, and I can see a few ways you add various elements of this array together to get that, but it's not obvious to me how you do that. Do you add every single pair together and find the max?
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 →
I understand your logic but your method doesn't make any sense.
Given the sample question:
The resulting transformations to the array are
It's not clear to me from this array how to calculate the accumulated slope. Obviously the answer is 10, and I can see a few ways you add various elements of this array together to get that, but it's not obvious to me how you do that. Do you add every single pair together and find the max?