728x90
반응형
https://programmers.co.kr/learn/courses/30/lessons/76501
using System;
public class Solution {
public int solution(int[] absolutes, bool[] signs) {
int answer = 0;
for (int i = -1; ++i < absolutes.Length;)
{
if (signs[i]) answer += absolutes[i];
else answer -= absolutes[i];
}
return answer;
}
}
반응형
'프로그래머스_C# > Level_1' 카테고리의 다른 글
[프로그래머스 C#] 4주차 직업군 추천하기 (0) | 2021.09.10 |
---|---|
[프로그래머스 C#] 숫자 문자열과 영단어 (0) | 2021.09.09 |
[프로그래머스 C#] 소수 만들기 (0) | 2021.09.08 |
[프로그래머스 C#] 내적 (0) | 2021.09.08 |
[프로그래머스 C#] 모의고사 (0) | 2021.09.07 |