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.
Same here: three of the cases timeout out in Python 2/3 and PyPy 3.
Another poster had a full solution in Python, stating that was working, same general mergesort implementation. I profiled both with cProfile, and measured total time, and both solutions where within 100 ms for Case 11.
I used a single (two, counting input) array allocation, and pivots, and still couldn't make it work. No append, no recursive len(). Don't know where else I could save time.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Merge Sort: Counting Inversions
You are viewing a single comment's thread. Return to all comments →
Same here: three of the cases timeout out in Python 2/3 and PyPy 3.
Another poster had a full solution in Python, stating that was working, same general mergesort implementation. I profiled both with cProfile, and measured total time, and both solutions where within 100 ms for Case 11.
I used a single (two, counting input) array allocation, and pivots, and still couldn't make it work. No append, no recursive len(). Don't know where else I could save time.