-
217. Contains Duplicate javaLeetCode_Study_Plan/Programming Skills 2022. 9. 24. 15:57
https://leetcode.com/problems/contains-duplicate/?envType=study-plan&id=programming-skills-i
class Solution { public boolean containsDuplicate(int[] nums) { HashMap<Integer,Integer> map = new HashMap<Integer,Integer>(); for (int num: nums){ if (map.containsKey(num)){ return true; } else { map.put(num, 1); } } return false; } }
'LeetCode_Study_Plan > Programming Skills' 카테고리의 다른 글
1603. Design Parking System java (0) 2022.09.25 1356. Sort Integers by The Number of 1 Bits java (1) 2022.09.24 242. Valid Anagram java (0) 2022.09.24 232. Implement Queue using Stacks java (0) 2022.09.24 404. Sum of Left Leaves java (0) 2022.09.24