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.
Even though I'm heapifying the array only once and using min-heap to store and operate on the data, I'm getting timeouts from cases #20, #21, #22 and #23. (large inputs)
Jesse and Cookies
You are viewing a single comment's thread. Return to all comments →
Even though I'm
heapify
ing the array only once and using min-heap to store and operate on the data, I'm getting timeouts from cases #20, #21, #22 and #23. (large inputs)My submission is here: https://www.hackerrank.com/challenges/jesse-and-cookies/submissions/code/28210608 any ideas how I can make this faster? I could not spot any issues with my heap, my pop/push operations are O(logn).