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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 import java.util.*; class Solution { public int[] solution(int[] progresses, int[] speeds) { Queue q = new LinkedList(); List list = new ArrayList(); int length = progresses.length; for (int i = 0; i
import java.util.*; public class Solution { public int solution(int bridge_length, int weight, int[] truck_weights) { int time = 0; Queue boarding = new LinkedList(); Queue waiting = new LinkedList(); for (int t : truck_weights) { waiting.offer(new Truck(t, bridge_length)); } int remain_weight = weight; while (!(waiting.isEmpty() && boarding.isEmpty())) { if (!waiting.isEmpty()) { int nowWeight ..
class Solution { public int[] solution(int[] prices) { int[] answer = new int[prices.length]; for (int i = 0; i prices[j]){ answer[i] = j-i; break; } if(j==prices.length-1){ answer[i] = j-i; } } } return answer; } } - 다시 보니까 옛날에 푼거였던게 어이없음 스택/큐 문제라는데 그렇게 생각하는게 너무 복잡하고 더 어려운거같아서 for문으로 풀이
import java.util.LinkedList; import java.util.Queue; class Solution { public int solution(int[] priorities, int location) { int answer = 0; Queue q = new LinkedList(); for (int i = 0; i < priorities.length; i++) { q.offer(new Printer(i, priorities[i])); } while (!q.isEmpty()) { boolean flag = false; int com = q.peek().prior; // 맨 앞 for (Printer p : q) { if (com < p.prior) { flag = true; } } if (..
import java.util.*; class Solution { public ArrayList solution(int[] numbers) { ArrayList list = new ArrayList(); int leng = numbers.length; for (int i = 0; i < leng; i++) { for (int j = i+1; j < leng; j++) { list.add(numbers[i] + numbers[j]); } } HashSet result = new HashSet(list); list = new ArrayList(result); Collections.sort(list); return list; } } (1) 나의 풀이 1. list에 추가 2. HashSet 생성자에 list를..
- Total
- Today
- Yesterday
- 김영한 http
- 프로그래머스
- 백기선 스터디
- ㅇㄷㅇㅈ
- REST API
- 모던자바스크립트
- 프로그래머스 SQL
- 백준
- 드림코딩
- java
- 킹수빈닷컴
- HTTP 완벽가이드
- 패스트캠퍼스 컴퓨터공학 완주반
- HTTP 완벽 가이드
- 이펙티브자바 스터디
- http
- js promise
- 이펙티브자바 아이템59
- BOJ
- JS 딥다이브
- 김영한 JPA
- js api
- js array
- GCP
- dreamcoding
- 이펙티브자바 아이템60
- 가상 면접 사례로 배우는 대규모 시스템 설계 기초
- 이펙티브자바
- JPA 연관관계 매핑
- Spring Security
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |