Programming/LeetCode 17

[LeetCode] #26. Remove Duplicates from Sorted Array (reapeat : 0)

문제를 제대로 안읽고 풀엇더니 오래걸렸다. non-decreasing order는 오름차순이라는 뜻이고 , 중복 값을 제거한 배열의 길이를 반환하는 문제이다. Description 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..

[LeetCode] #27. Remove Element (repeat : 0)

지정된 배열의 요소를 삭제하는 문제이다. 배열의 인덱스만 변경해 간단하게 풀었다. Description 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: Chan..