88. Combine two ordered arrays
Idea:
Put array 2 into array 1 first, and then sort.
Looking at the problem-solving problem, I found that directly using slices is easy to read. The time complexity and space complexity are the same because slicing and then assigning uses an operation similar to a for loop.
Long knowledge.
27. Remove elements
Ideas
Traverse the array equal to val to delete. But using del will automatically move the array forward after deletion, and let the subscript continue to be equal to now after deletion. Finally, the length of the array is returned.
Of course, it is inefficient. Although it can be achieved, it is very silly! ! !
It is found that the reverse order is used to save the operation of leaving the subscript unchanged after deletion.