JAVA_LeetCode 3432_Count Partitions with Even Sum Difference 풀이 class Solution { public int countPartitions(int[] nums) { // 총합을 구하고, 배열을 나누면서 양쪽 배열 요소 값 합 차가 2로 나눴을 때 0인 경우를 찾는다. int tot = 0, cnt = 0, left = 0, right = 0; for(int num : nums) tot += num; for(int i = 0; i < nums.length - 1; i++){ left += nums[i]; right = tot - left; if((left - right) % 2 == 0) cnt++; } return cnt; } } * 출처 https://leetcode.com/problems/count-partitions-with-even-sum-difference...