목록백준 (42)
오늘이라도

문제 내 풀이 채점 결과 피드백 * 1.0 으로 double만들지 말고 (double)을 씌우자

문제 내 풀이 class Solution { public int solution(int n) { //소인수분해 후 없는 소수를 6에 곱해준다 //6과 n의 최소공배수/6 = answer int lcm = getLeastCommonMultiple(n, 6); return lcm >= 6 ? lcm / 6 : lcm; } private int getLeastCommonMultiple(int num1, int num2) { int lcm = 0; loop: for(int i = 1; i

문제 내 풀이 채점 결과 피드백 java.lang.Math

문제 내 풀이 채점 결과 피드백 Integer List를 int Array로 바꾸는 방법 int[] answer = tempList.stream().mapToInt(i -> i).toArray();

문제 내 풀이 import java.util.List; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.util.HashMap; import java.util.Comparator; class Solution { public int solution(int[] array) { int answer = 0; int[] tempArray = Arrays.stream(array).distinct().toArray(); Map tempMap = new HashMap(); for(int i : tempArray) { int count = 0; for(int j : array) { if(i == j) { count..