[프로그래머스] [LV1] 음양 더하기
업데이트:
📚 음양 더하기
링크📎 : https://programmers.co.kr/learn/courses/30/lessons/76501
난이도 ⭐️
📖 문제
📝 내 풀이
class Solution {
public int solution(int[] absolutes, boolean[] signs) {
int answer = 0;
for(int i = 0; i < absolutes.length; i++){
answer += (signs[i] ? absolutes[i] : -1*absolutes[i]);
}
return answer;
}
}
너무 쉬웠다..
끝-!
댓글남기기