[Easy] LeetCode - no.219 Contains Duplicate II : Java
https://leetcode.com/problems/contains-duplicate-ii/description/?envType=study-plan-v2&envId=top-interview-150 문제int 배열 nums가 주어졌을 때, 똑같은 숫자끼리의 인덱스 차이가 k 이하인지 여부 판단Example 1:Input: nums = [1,2,3,1], k = 3 Output: true Example 2:Input: nums = [1,0,1,1], k = 1 Output: true Example 3:Input: nums = [1,2,3,1,2,3], k = 2 Output: false 풀이1 public static boolean containsNearbyDuplicate(int[] nums,..
2024. 10. 17.