프로그래머스LV1 - 음양 더하기
[ 답안 ]
class Solution {
public int solution(int[] absolutes, boolean[] signs) {
int answer = 0;
String buho = "";
for(int i = 0 ; i < absolutes.length;i++){
buho = (signs[i])? "+" : "-" ;
answer += Integer.parseInt(buho+absolutes[i]);
}
return answer;
}
}