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.
O(n^3), im very surprised this passed, at each iteration O(n^2) operations are needed and i tried to improve this algo to only use O(n) operations at each iteration, so total time would be O(n^2), but couldn't. submitted this and was shocked to see it pass
there's probably a O(n^2) algo if u fiddle with the permutation terms
Sherlock's Array Merging Algorithm
You are viewing a single comment's thread. Return to all comments →
O(n^3), im very surprised this passed, at each iteration O(n^2) operations are needed and i tried to improve this algo to only use O(n) operations at each iteration, so total time would be O(n^2), but couldn't. submitted this and was shocked to see it pass
there's probably a O(n^2) algo if u fiddle with the permutation terms