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 only need to update the start and end of each range.
for the first example we are going to have 3 queries I'm going to represent it in 3 rows, and we know that the max length of the array is 5, but for this problem we are actually going to need an extra space to avoid out of range errors:
Input:53121002510034100
1234561100-1002100-1003100-100
This was a visual representation of each input query but actually we would end up with this array:
123456[10010000-100-100]
Finally we have to sum each value and keep track of the max value:
Array Manipulation
You are viewing a single comment's thread. Return to all comments →
We only need to update the start and end of each range. for the first example we are going to have 3 queries I'm going to represent it in 3 rows, and we know that the max length of the array is 5, but for this problem we are actually going to need an extra space to avoid out of range errors:
This was a visual representation of each input query but actually we would end up with this array:
Finally we have to sum each value and keep track of the max value:
Python solution
`