description-paste here Approach Used : Code (C++) Time Complexity: O(n): desc Space Complexity: O(1): no extra space is used. Connect With Me :