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.
Example: nums = [5,2,4,1,3] → [1,2,3,4,5].
Bubble sort runs in O(n²) worst case but is the easiest sort to visualize — every swap is local.
[1,2,3,4,5]