Sum of Sortable Integers

Solution Code

Time Complexity

O(n\sqrt{n})

Space Complexity

O(n)