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

JAVA_Fair Candy Swap_LeetCode 888

 JAVA_Fair Candy Swap_LeetCode 888

JAVA_Fair Candy Swap_LeetCode 888 풀이 class Solution { public int[] fairCandySwap(int[] aliceSizes, int[] bobSizes) { int sum = (IntStream.of(aliceSizes).sum() - IntStream.of(bobSizes).sum()) / 2; HashSet set = new HashSet(); for (int num1 : aliceSizes) set.add(num1); for (int num2 : bobSizes){ if (set.contains(num2 + sum)) return new int[] {num2 + sum, num2}; } return new int[0]; } } * 출처 Fair Candy Swap - LeetCode Can you solve this real interview question? Fair Candy Swap - Alice an...

# FairCandySwap_LeetCode888 # JAVA # JAVA_FairCandySwap # JAVA_FairCandySwap_LeetCode888 # JAVA_LeetCode888