Brilliant sorting algorithm with complexity O(max(n))