목록전체 글 (167)
GaGe
개발자 직군이 내 적성에 맞을까 휴학하고 다른 건 하고 싶었어도 코딩하고 싶다는 생각은 안 들었다. 그게 휴학의 목표이긴 했지만 쭉쭉 잘하는 주변 사람들을 보면서 이 길이 내 길이 맞는지 의구심이 든다.
import java.util.Arrays; class Solution { public int[] solution(int[] array, int[][] commands) { int[] answer = new int [commands.length]; for(int i =0; i
import java.util.Queue; import java.util.LinkedList; class Solution { class Truck { //트럭 각각의 무게와 입장시간을 기억하는 구조체(이 세트로 큐에 들어감) int weight; int start; Truck(int weight, int start){ this.weight = weight; this.start = start; } } public int solution(int bridge_length, int weight, int[] truck_weights) { Queue a = new LinkedList(); //Truck구조체로 설정 Queue b = new LinkedList(); for(int i = 0 ; i < truck_we..
class Solution { public int[] solution(int[] prices) { int[] answer = new int [prices.length]; for(int i=0; i
class Solution { public int[] solution(int[] heights) { int[] answer = new int [heights.length]; for(int i = heights.length-1 ; i>=0 ; i--){ for(int j = i ; j>=0 ; j--){ if(heights[j]>heights[i]){ answer[i]=j+1; break; } if(j==0){ answer[i]=0; break; } } } return answer; } }