2025/04/12 3

[프로그래머스] 튜플

문제 https://school.programmers.co.kr/learn/courses/30/lessons/64065 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr  입출력  아이디어- 앞 뒤 {{ }} 제거 - 정규 표현식 작성- 이미 앞에서 있던 값은 제외    코드  import java.util.*;class Solution { public int[] solution(String s) { s = s.substring(2, s.length() - 2); // 앞 "{{", 뒤 "}}" 제거 String[] groups = s.split("\\},\\{"); // "..

Java 2025.04.12

[프로그래머스] 호텔 대실

문제https://school.programmers.co.kr/learn/courses/30/lessons/155651 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr   입출력  아이디어 - 시간 (String) 비교할 때 분으로 바꿔서 계산하기 !- PriorityQueue 사용 (그리디) 생각해보면 가장 짧은 시간 먼저 찾으면 됨  코드  import java.util.*;class Solution { public int solution(String[][] book_time) { int answer = 0; Arrays.sort(book_time, ..

Java 2025.04.12

[프로그래머스] 숫자 변환하기

문제https://school.programmers.co.kr/learn/courses/30/lessons/154538 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr   코드  import java.util.*;class Solution { public int solution(int x, int y, int n) { Queue queue = new LinkedList(); boolean[] visited = new boolean[y + 1]; // 0~y 까지 queue.add(new int[]{y, 0}); visited[y] = true; ..