class Solution {
public int solution(int[] absolutes, boolean[] signs) {
int answer = 0;
int[] sub_answer = new int[absolutes.length];
for(int i = 0; i < absolutes.length; i++) {
if(signs[i] == true) {
sub_answer[i] = absolutes[i];
}else {
sub_answer[i] = -absolutes[i];
}
answer += sub_answer[i];
}
return answer;
}
}