Leetcode:80. 删除有序数组中的重复项 II

Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place such that each unique element appears at most twice. The relative order of the elements should be kept the same. Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements...

Leetcode:26删除有序数组中的重复项

Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same. Then return the number of unique elements in nums. Consider the number of unique elements of nums to be k, to get accepted, you need to do the following things: Change the array nums such that the first...

Leetcode:27移除元素

Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements may be changed. Then return the number of elements in nums which are not equal to val. Consider the number of elements in nums which are not equal to val be k, to get accepted, you need to do the following things: Change the array nums such that...

Leetcode:88合并两个有序数组

LeetCode上“最简单”的一道题了吧? 长时间没有写过题,面试的时候竟然不会写了,奇耻大辱的一件事! You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n,...