음양 더하기

suhan cho·2022년 7월 28일
0
class Solution {
    public int solution(int[] absolutes, boolean[] signs) {
        int answer = 123456789;
        int i =0;
        int count =0;
        
        for(int x : absolutes){
            if(signs[i]) count += x;
            else count -= x;
            i++;
        }
        
        answer = count;
        return answer;
    }
}
profile
안녕하세요

0개의 댓글