leetcode
[leetcode] 26. Remove Duplicated from Sorted Array
https://leetcode.com/problems/remove-duplicates-from-sorted-array/?envType=study-plan-v2&envId=top-interview-150 문제 오름차순 정수 배열 nums 가 주어졌을 때 같은 숫자가 한 번만 오게끔 중복을 제거하는 문제이다. 문제 조건으로는 in-place 알고리즘을 사용하고 반환값으로 중복을 제거한 정수 배열 길이를 출력하라고 요구하고 있다. 풀이 class Solution { public int removeDuplicates(int[] nums) { int index = 1; for (int i = 0; i < nums.length - 1; i++) { if (nums[i] != nums[i + 1]) { nums[in..