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
|
936 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
Don't know if this is optimized or not but this is my solution in C++
Here is my Python solution!
Managed to write this in python, it works but is not optimised:
SAD:
No rust option T_T