Code func merge(nums1 []int, m int, nums2 []int, n int) { copy(nums1[m:], nums2) sort.Ints(nums1) } Solution in mind Copy second array into empty positions of first. Sort first array.