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.
but it says the max number is not the expected one, at the end, seems like with sum prefix we can recreate the same array I generate each query so I cannot see why the returned max value is not correct, if anyone has an answer, I would be glad to reaad i it, thanks.
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 →
Hi, I've seen many use the prefix sum algorithm to solve this problem, before looking into it I was trying with this:
but it says the max number is not the expected one, at the end, seems like with sum prefix we can recreate the same array I generate each query so I cannot see why the returned max value is not correct, if anyone has an answer, I would be glad to reaad i it, thanks.