일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 코딩테스트
- 프로그래머스 연속된 수의 합 java
- Arrays
- java
- 프로그래머스 도둑질 java
- 백준 15661
- 백준 11723
- Codility
- java 올림
- 네트워크
- 백준 18290
- java 내림
- 자바
- mysql
- 백준 17425
- time complexity
- 프로그래머스 숫자의 표현 java
- 0으로 채우기
- Math.ceil()
- Math.floor()
- java 반올림
- 백준 14391
- 프로그래머스 옹알이 java
- 알고리즘
- Algorithm
- 백준 16927
- 프로그래머스 네트워크 java
- 백준 16935
- sort
- 백준 4375
- Today
- Total
목록Algorithm/Programmers (5)
취미처럼
https://school.programmers.co.kr/learn/courses/30/lessons/120923 음수를 연속해서 더하는 경우도 생각해야 함 num = 6, total = 3 -2, -1, 0, 1, 2, 3 class Solution { public int[] solution(int num, int total) { int[] answer = new int[num]; int number = 0; int sum; for(int i = -1000; i
https://school.programmers.co.kr/learn/courses/30/lessons/120956 문자가 연속된 부분을 미리 제거해준다. class Solution { public int solution(String[] babbling) { int answer = 0; String[] arr = {"aya", "ye", "woo", "ma"}; String[] ban = {"ayaaya", "yeye", "woowoo", "mama"}; for(int i = 0; i < babbling.length; i++) { for(int k = 0; k < ban.length; k++) { babbling[i] = babbling[i].replace(ban[k], "x"); } for(int j ..
https://school.programmers.co.kr/learn/courses/30/lessons/12924 class Solution { public int solution(int n) { int answer = 1; // 자기자신 n for(int i = 1; i
https://school.programmers.co.kr/learn/courses/30/lessons/43162 방문체크를 하는 visit 배열을 컴퓨터 개수 n개로 생성 각각의 컴퓨터 노드를 모두 탐색 1일때만 탐색하거나 큐에 넣어서 answer를 늘려줌 import java.util.*; class Solution { public int solution(int n, int[][] computers) { int answer = 0; boolean[] visit = new boolean[n]; for(int i = 0; i < n; i++) { if(!visit[i]) { dfs(computers, visit, i); answer++; } } return answer; } public void dfs(..
https://school.programmers.co.kr/learn/courses/30/lessons/42897 첫번째 집을 훔칠 경우 - 마지막 집을 훔칠 수 없음 두번째 집부터 훔칠 경우 - 마지막 집을 훔칠 수 있음 import java.util.*; class Solution { public int solution(int[] money) { int answer = 0; int[] dp = new int[money.length]; int[] dp2 = new int[money.length]; dp[0] = money[0]; dp[1] = money[0]; dp2[0] = 0; dp2[1] = money[1]; for(int i=2; i< money.length; i++) { dp[i] = Math..