섬 연결하기 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr코드import java.util.*;class Solution { public int solution(int n, int[][] costs) { int answer = 0; // 최종적으로 반환할 최소 비용 // 그래프를 인접 리스트로 표현 List> graph = new ArrayList(); for (int i = 0; i ()); // 각 섬(i)에 대한 간선 리스트 초기화 } // 주어진 비용 배열을 기반으로 그래프의 간선을 추가..
조이스틱class Solution { public int solution(String name) { // 알파벳 바꾸는 횟수 int answer = 0; // 오른쪽으로 쭉 갈때 가능한 조작횟수 int move = name.length() - 1; for (int i = 0; i 문제 풀이 / 알고리즘기본 변수 설정int answer = 0; // 알파벳을 변경하는데 필요한 상하 조작 횟수int move = name.length() - 1; // 기본 이동 횟수 (오른쪽으로 쭉 이동하는 경우)알파벳 변경 횟수 계산answer += Math.min(name.charAt(i) - 'A', ('Z' + 1) - name.charAt(i))..
- Total
- Today
- Yesterday
- Spring Security
- Effective Java
- Kotlin
- Greedy
- 디자인패턴
- Java
- db
- brute-force
- Spring
- Security
- Annotation
- Algorithm
- 백준
- 생활코딩
- Spring Boot
- programmers
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |