로딩
요청 처리 중입니다...

JAVA_Intersection of Two Arrays_LeetCode 349

 JAVA_Intersection of Two Arrays_LeetCode 349

JAVA_Intersection of Two Arrays_LeetCode 349 풀이 class Solution { public int[] intersection(int[] nums1, int[] nums2) { Set set1 = new HashSet(); Set set2 = new HashSet(); for(int i : nums1) set1.add(i); for(int i : nums2) set2.add(i); set1.retainAll(set2); int n = set1.size(); int[] res = new int[n]; int index = 0; for(int i : set1) res[index++] = i; return res; } } * 출처 Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get ...

# IntersectionofTwoArrays_LeetCode349 # JAVA # JAVA_IntersectionofTwoArrays # JAVA_IntersectionofTwoArrays_LeetCode349 # JAVA_LeetCode349