일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- NextJS
- codesandbox
- 장고
- 자바스크립트
- websocket
- 코딩테스트 고득점 Kit 완전탐색
- 프로그래밍 언어론
- Java
- 리액트
- 백준
- react hook
- 코딩테스트 고득점 Kit
- React JS
- react
- 컴퓨터 네트워크
- useEffect
- vanillaJS
- design pattern
- 프로그래머스 자바
- 자바 공부
- 프로그래머스 완전탐색
- 디자인 패턴
- 프로그래머스
- useState
- JavaScript
- 코틀린
- 리액트 훅
- 자바
- 데이터모델링과마이닝
- react firebase
- Today
- Total
목록Algorithm (90)
기록하는 개발자

import java.util.*; class Solution { public String solution(String[] participant, String[] completion){ String answer = ""; int temp; // key : 참가자명, value : 해당 이름을 가진 사람 수 Map par=new HashMap(); // /*hashmap에 참가자를 추가하는 반복문*/ for(int i=0; i

import java.util.*; class Solution { public int solution(int[] nums) { int answer = 0; List list = new ArrayList(); list.add(nums[0]); //배열의 첫 번째 요소를 list에 삽입 for(int i=1; i list 길이=폰켓몬 종류 if(!list.contains(nums[i])) //list가 배열의 i번째 요소를 갖고 있지 않은 경우에만 list.add(nums[i]); //list에 i번째 요소를 추가한다. // list.size(): 폰켓몬 종류, nums.length/2 : 선택 가능한 최대 폰켓몬 수 /*아래 삼항연산자 내용 - 폰켓몬 종류 보다 N/2가 더 크면 폰켓몬 종류를 반환한다. ..

import java.util.*; class Solution { public int[] solution(int[] answers) { int[] temp = {0,0,0}; int[] one={1,2,3,4,5}; int[] two={2,1,2,3,2,4,2,5}; int[] three={3,3,1,1,2,2,4,4,5,5}; int max=0, count=3; for(int i=0; i=temp[1])? temp[0] : temp[1]; //최댓값 찾기 max=(max>=temp[2])? max : temp[2]; if (max == 0) //최댓값이 0인 경우 빈 배열 return return new int[] {}; List result = new ArrayList(); for (int i = 0..

import java.io.IOException; import java.util.Scanner; public class Main{ static int[][] adjacent; static boolean[][] checked; static int n,m,k,T,temp; static StringBuilder sb = new StringBuilder(); public static void main(String[] args) throws IOException { Scanner s = new Scanner(System.in); T = s.nextInt();//테스트케이스 개수 for(int j=0; j= m) //좌표값이 잘못된 경우 return false; if(checked[row][col] == true ..

import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner s = new Scanner(System.in); int n=s.nextInt(); int cost[][]=new int[n][3]; int color[][]=new int[n][3]; for(int i=0; i

import java.io.IOException; import java.util.Scanner; public class Main{ static int[][] adjacent; //컴퓨터 연결상태 static boolean[] checked; //확인 여부 static int n,m,num=0; public static void main(String[] args) throws IOException { Scanner s = new Scanner(System.in); n = s.nextInt(); m = s.nextInt(); adjacent = new int[n+1][n+1]; checked = new boolean[n+1]; for(int i = 0; i < m; i++) { int x = s.nextIn..

내가 풀기는 커녕 기를 쓰고 풀다가 자꾸 타임아웃에 걸려 결국 남의 코드를 봤다 역시나 재귀를 사용하지 않았던 것이 문제였던 것 같다. 남의 코드를 봐도 이해가 안됐지만 예제 입력에 있는 가장 간단한 예시를 넣어보면서 이해했다. 다른 사람이 짠 코드가 재귀를 사용하는데 이해가 안된다면 무조건 손으로 따라 가보는 것을 추천한다. import java.io.*; import java.util.*; public class Main{ static int[][] adjacent; static boolean[] checked; static int n,m,start; public static void main(String[] args) throws IOException { Scanner s = new Scanner(..