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.
- Jesse and Cookies
- Discussions
Jesse and Cookies
Jesse and Cookies
Sort by
recency
|
176 Discussions
|
Please Login in order to post a comment
Python:
Fairly confident the size of remaining cookies' sweetness should reduce by 1 every time a calculation is completed; however the example shows a step where that does not happen.
My answer with Typescript.
Firsts of all, i tried using loop and sequential search/sort to find the 2 smallest elements, it worked but not fast enough.
Then i tried using MinHeap and it was surprisingly fast, all tests completed instantly
JavaScript Solution :-