uploaded at 2022. 12. 17. 오후 8:11:20
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
// [문제 링크]: https://school.programmers.co.kr/learn/courses/30/lessons/76501?language=java
|
||||||
|
|
||||||
|
class Solution {
|
||||||
|
public int solution(int[] absolutes, boolean[] signs) {
|
||||||
|
int answer = 0;
|
||||||
|
for(int i = 0; i < absolutes.length; i++){
|
||||||
|
answer += absolutes[i]*((signs[i])?1:-1);
|
||||||
|
}
|
||||||
|
return answer;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user