Given an integer array nums, sort it in non-decreasing order using the recursive form of Bubble Sort. In one pass, adjacent elements are compared and swapped if out of order; after one pass the largest element is guaranteed to be at the end. You should then recurse on the first n-1 elements. Return the sorted array.
Input: An integer array nums.
Output: Return the sorted array as [v1,v2,...] (non-decreasing).
Input: [5,1,4,2,3]
Output: [1,2,3,4,5]
Explanation: First pass bubbles 5 to the end; recurse on the first 4; final sorted array is [1,2,3,4,5].Input: [1]
Output: [1]
Explanation: A single element is already sorted.Input: [3,3,3]
Output: [3,3,3]
Explanation: All equal elements are already in non-decreasing order.1 <= nums.length <= 100-10^9 <= nums[i] <= 10^9