일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 혼공파
- 정처기
- Til
- 안드로이드스튜디오
- 우테코
- join
- SQL
- 스터디
- 인프런
- Kotlin
- 혼공챌린지
- 안드로이드
- select
- doitandroid
- 프로그래머스
- 코딩
- 코딩테스트
- 코틀린
- Android
- CS
- 우아한테크코스
- 코테
- 자바
- 카카오코테
- java
- MySQL
- navermap
- 혼공단
- 정보처리기사
- groupby
- Today
- Total
목록프로그래머스/알고리즘 고득점 Kit (2)
Welcome! Everything is fine.
📌 문제 📌 코드 import java.util.*; class Solution { public int solution(String[][] clothes) { // clothes 크기 만큼의 map 생성 HashMap map = new HashMap(clothes.length); // clothes[i][0] : 의상 이름, clothes[i][1] : 의상 종류 for (String[] cloth : clothes) { if (map.containsKey(cloth[1])) { // map에 해당 의상 종류가 있으면 실행 map.put(cloth[1], map.get(cloth[1]) + 1); // 그 전 value에 +1 continue; } map.put(cloth[1], 1); // map에 해..
📌 문제 📌 코드 import java.util.*; class Solution { public String solution(int[] numbers) { StringBuilder answer = new StringBuilder(); String[] strArr = new String[numbers.length]; for (int i = 0; i < numbers.length; i++) { strArr[i] = String.valueOf(numbers[i]); // numbers의 요소를 String으로 바꿔 새 배열에 추가 } Arrays.sort(strArr, new Comparator() { // 정렬 기준을 정의한 객체인 Comparator를 이용해 정렬 public int compare(Stri..