Use algorithm from Kamil:
Excluding sorting, this is O(n) which should be much faster and much simpler and easier to understand.
Showing
Please register or sign in to comment
Excluding sorting, this is O(n) which should be much faster and much simpler and easier to understand.