https://school.programmers.co.kr/learn/courses/30/lessons/120871 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(int n) { int answer = n; int i = 1; while (i
https://school.programmers.co.kr/learn/courses/30/lessons/120878 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(int a, int b) { int den = b / gcd(a, b); while (den != 1) { if (den % 2 == 0) { den /= 2; } else if (den % 5 == 0) { den /= 5; } else { return 2; } } return 1; } private int gcd(i..
https://school.programmers.co.kr/learn/courses/30/lessons/120882 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 import java.util.ArrayList; import java.util.Comparator; import java.util.List; class Solution { public int[] solution(int[][] score) { List scoreList = new ArrayList(); for(int[] s : score){ scoreList.add(s[0] + s[1..
https://school.programmers.co.kr/learn/courses/30/lessons/120884 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(int chicken) { int answer = 0; while (chicken > 9) { answer += chicken / 10; chicken = chicken / 10 + chicken % 10; } return answer; } } 다른 풀이 class Solution { public int solution..
https://school.programmers.co.kr/learn/courses/30/lessons/120883 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public String solution(String[] id_pw, String[][] db) { for (String[] data : db) { if (data[0].equals(id_pw[0])) { if (!data[1].equals(id_pw[1])) return "wrong pw"; return "login"; } } return "fail";..
https://school.programmers.co.kr/learn/courses/30/lessons/120860 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(int[][] dots) { int maxX = -256; int maxY = -256; int minX = 256; int minY = 256; for (int[] dot : dots) { maxX = Math.max(maxX, dot[0]); minX = Math.min(minX, dot[0]); maxY = Mat..
https://school.programmers.co.kr/learn/courses/30/lessons/120861 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int[] solution(String[] keyinput, int[] board) { int weight = board[0] / 2; int height = board[1] / 2; int x = 0; int y = 0; for (String input : keyinput) { int nx = x; int ny = y; switch (inp..
https://school.programmers.co.kr/learn/courses/30/lessons/120922 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(int M, int N) { return (N-1) * M + (M-1); } }
https://school.programmers.co.kr/learn/courses/30/lessons/120869 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(String[] spell, String[] dic) { for (String str : dic) { boolean chk = true; for (String sp : spell) { if (!str.contains(sp)) { chk = false; break; } str = str.replaceAll(sp, "");..
https://school.programmers.co.kr/learn/courses/30/lessons/120868 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(int[] sides) { return (sides[0] + sides[1]) - (Math.abs(sides[0] - sides[1])) - 1; } }