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.
Flatland Space Stations
Flatland Space Stations
Sort by
recency
|
929 Discussions
|
Please Login in order to post a comment
Here is my easy c++ solution, you can watch the explanation here : https://youtu.be/k2pd5_9mseI
This algorithm is actually O(Nlog(N)) because of the sorting, we can make it O(N) by using a counting sort since we know what the maximum element of our array will be. you will have to replace the line
with this
And add this sort function in your editor