알고리즘/프로그래머스 2단계7 [프로그래머스] 최댓값과 최솟값 프로그래머스 2단계 최댓값과 최솟값 https://programmers.co.kr/learn/challenges 문제 설명 풀이 import java.util.*; class Solution { public String solution(String s) { String strArr[] = s.split(" "); int intArr[] = new int[strArr.length]; for (int i=0; i 2022. 6. 6. [프로그래머스] 숫자의 표현 프로그래머스 2단계 숫자의 표현 https://programmers.co.kr/learn/challenges 문제 설명 풀이 class Solution { public int solution(int n) { int startNum = 1; int answer = 0; while (startNum 2022. 6. 5. [프로그래머스] 124 나라의 숫자 프로그래머스 2단계 124 나라의 숫자 https://programmers.co.kr/learn/challenges 문제 설명 풀이 class Solution { public String solution(int n) { StringBuilder sb = new StringBuilder(); int count = 1; while (n>0){ count = n % 3; n = n / 3; if(count == 0){ n = n - 1; count = 4; } sb.insert(0, count); } return sb.toString(); } } 2022. 6. 5. 이전 1 2 다음