You are viewing a single comment's thread. Return to all comments →
Hi,
Your solution is good but it will take O(nlogn) time due to sorting which can be optimized to O(n)
Here is the video explanation of my solution in O(n) time -
https://youtu.be/1gxFE9EfanE
Any comments and feedback will be appreciated.
Seems like cookies are disabled on this browser, please enable them to open this website
Birthday Cake Candles
You are viewing a single comment's thread. Return to all comments →
Hi,
Your solution is good but it will take O(nlogn) time due to sorting which can be optimized to O(n)
Here is the video explanation of my solution in O(n) time -
https://youtu.be/1gxFE9EfanE
Any comments and feedback will be appreciated.