일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 이클립스
- r
- 프로그래머스
- Q타입클래스
- 자바
- cor()
- core.autocrlf
- 이중배열
- git
- git오류
- programmers
- R프로그래밍
- 알고리즘
- LIKE검색
- 머신러닝
- R명령어
- Eclipse
- querydsl적용하기
- Rstudio
- java
- summary()
- DTO사용이유
- stepfilter
- JPA
- 한글깨지는문제
- queryDSL
- RProgramming
- Spring
- 머신러닝프로세스
- str()
- Today
- Total
목록Algorithm/Programmers (3)
놀고 싶어요

public class 비밀지도 { public static void main(String[] args) { System.out.println(Arrays.toString(solution(5, new int[]{9, 20, 28, 18, 11}, new int[]{30, 1, 21, 17, 28}))); } public static String[] solution(int n, int[] arr1, int[] arr2) { char[][] map1 = changeTwoArray(n, arr1); char[][] map2 = changeTwoArray(n, arr2); char[][] newMap = new char[n][n]; for (int i = 0; i < n; i++) { for (int j = 0..

문제 분류가 떡하니 DFS/BFS로 되어 있다. 문제를 읽다보니 bit masking으로도 풀이가 가능해서 bit masking으로 풀이한 코드를 공유하려고 한다. 비트 마스킹을 이용한 풀이 class Solution { public int solution(int[] numbers, int target) { int answer = 0; // 0 ~ 2^(numbers.length-1) for (int i = 0; i < (1

package programmers; import java.util.HashSet; import java.util.Set; /** * https://programmers.co.kr/learn/courses/30/lessons/1845 */ public class 폰켓몬 { public static int solution(int[] nums) { int answer = 0; Set n = new HashSet(); // set은 중복이 없음 // nums 배열에 있는 숫자를 입력한다. for(int i=0; i