Sort the integer array nums in ascending order using bubble sort and return the result. Repeatedly walk the array, swapping adjacent out-of-order pairs; after each pass the largest unsorted element settles at the end.
Bubble sort runs in O(n²) worst case but is the easiest sort to visualize — every swap is local.
1 ≤ nums.length ≤ 1000-10⁴ ≤ nums[i] ≤ 10⁴Outer loop: n - 1 passes. Inner loop: compare-and-swap adjacent pairs.