Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- 프로그래머스 풀이
- 오름차순 정렬
- 자바
- 프로그래머스
- 스프링부트 도커
- java
- Lv1
- lv0
- 프로그래머스 문자열 정렬
- StringTokenizer
- 스택
- Stack
- 이진수 변환
- 삼각형의 완성조건
- 스프링부트 도커 배포
- 스프링부트 도커로 배포
- 프로그래머스 자바
- 큐
- lv2
- 클라이언트
- 문자열
- 백준
- 버퍼
- 알고리즘
- 백준 N과 M 자바
- Queue
- COS Pro
- SWEA
- Programmers
- index of
Archives
- Today
- Total
mun dev
[Programmers] 자바 삼각형의 완성 조건 본문
문제 설명

✅ 통과한 코드
import java.util.Arrays;
class Solution {
public int solution(int[] sides) {
int answer = 0;
int max= sides.length-1;
Arrays.sort(sides);
if(sides[max]<sides[0]+sides[1])
answer=1;
else
answer=2;
return answer;
}
}
✅ 입출력 결과

'알고리즘 > 프로그래머스' 카테고리의 다른 글
| [Programmers] 자바 팩토리얼 (0) | 2023.01.12 |
|---|---|
| [Programmers] 자바 숫자 찾기 (0) | 2023.01.11 |
| [Programmers] 자바 합성수 찾기 (0) | 2023.01.10 |
| [Programmers] 자바 대문자와 소문자 (0) | 2023.01.06 |
| [Programmers] 자바 공던지기 (0) | 2023.01.05 |