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.
- Prepare
- Algorithms
- Greedy
- Priyanka and Toys
- Discussions
Priyanka and Toys
Priyanka and Toys
Sort by
recency
|
499 Discussions
|
Please Login in order to post a comment
Here is my c++ solution, you can watch the explanation here : https://youtu.be/Es5l0jbSH9I
My Java solution with o(n log n) time complexity and o(1) space complexity:
Here is my Python solution!