Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- error
- db
- 자바
- JPA
- 생성
- 방법
- 넥사크로
- jquery
- 알고리즘
- Git
- kotlin
- 프로그래머스
- Spring
- 코틀린
- 시큐리티
- 함수
- 쿼리
- JavaScript
- GitHub
- Security
- aws
- IntelliJ
- Vue
- oracle
- 에러
- mybatis
- Java
- 오라클
- Eclipse
- 스프링
Archives
- Today
- Total
송민준의 개발노트
[프로그래머스] 음양 더하기 본문
https://programmers.co.kr/learn/courses/30/lessons/76501?language=java
class Solution {
public int solution(int[] absolutes, boolean[] signs) {
int result = 0;
for(int i = 0; i < absolutes.length; i++) {
result += absolutes[i] * (signs[i] ? 1 : -1);
}
return result;
}
}
'알고리즘 > 프로그래머스' 카테고리의 다른 글
[프로그래머스] 오픈채팅방 (0) | 2022.04.28 |
---|---|
[프로그래머스] 더 맵게 (0) | 2022.04.25 |
[프로그래머스] 없는 숫자 더하기 (0) | 2022.04.18 |
[프로그래머스] 키패드 누르기 (0) | 2022.04.18 |
[프로그래머스] 숫자 문자열과 영단어 (0) | 2022.04.10 |