题目
class Solution {
public void merge(int[] nums1, int m, int[]
nums2, int n) {
List<Integer> list = new
ArrayList<Integer>();
int tm = 0, tn = 0;
while(tm<m && tn<n){
if(nums1[tm]<nums2[tn]){
list.add(nums1[tm]);
tm++;
}else{
list.add(nums2[tn]);
tn++;
}
}
while(tm<m){
list.add(nums1[tm]);
tm++;
}
while(tn<n){
list.add(nums2[tn]);
tn++;
}
for(int i=0; i<m+n; i++){
nums1[i] = list.get(i);
}
}
}