Ad
  • Custom User Avatar

    Hi,

    Great solution. Thought of something similar. But went against it because even the best sorting algo. has O(nlogn) time complexity. So, shouldn't we just use a couple of integers to compare and get it done in O(n) - time, O(1) - space? Just a thought! :)