
int배열에서 두 수의 합이 target일 때, 이 두 수의 index를 배열로 반환하는 문제이다. e.g. {1, 4, 7, 8}, 11 → 4 + 7 = 11 → {1, 2} int배열과 단일 int를 매개변수로 받는 twoSum 메서드의 틀이 주어진다. Problem : public class TwoSum { public int[] twoSum(int[] nums, int target) { } } 풀이는 주어진 twoSum 메서드에 작성하면 된다. Solution1 : 매우 간단한 방법으로 이중 for문을 이용해 다음과 같이 풀 수 있다. (반목문을 통해 두 수의 합이 target과 일치하는지 확인하는 방법) public class TwoSum { // time complexity : for dou..

새로운 자료구조를 생성하지 않고, 주어진 int배열에서 0을 배열의 뒤로 모두 옮기는 문제이다. e.g. {0, 3, 4, 0, 1, 0} -> {3, 4, 1, 0, 0, 0} int 배열을 매개변수로 받는 moveZeroes 메서드의 틀이 주어진다. Problem : public class MoveZeroes { public void moveZeroes(int[] nums) { } } 풀이는 주어진 moveZeros 메서드에 작성하면 된다. Solution : 0이 아닌 숫자를 앞에서부터 채운다. 0이 아닌 숫자를 채운 마지막 index를 기억한다. 해당 index부터 배열 끝까지 0으로 채운다. public class MoveZeroes { // time complexity : loop for in..

회의실 예약 시간(interval)이 유효한지를 알아보는 문제이다. 인스턴스변수 start, end를 가진 Interval 클래스와 Interval 배열을 매개변수로 받는 solve 메서드의 틀이 주어진다. Problem : class Interval{ int start; int end; Interval(){ this.start = 0; this.end =0; } Interval(int start, int end){ this.start = start; this.end = end; } } public class MeetingRooms { public boolean solve(Interval[] intervals) { } } 풀이는 solve 메서드에 작성하면 된다. Solution : 매개변수로 들어오는 ..

Hello, this is Dev_dog. In this post, We're going to figure out how to apply and deploy the officially supported embedded server 'UNDERTOW'. If you find any errors or have any questions, feel free. 한글 포스트는 아래 링크에서 보실 수 있습니다 : [KR/JAVA] - [SpringBoot] Undertow 적용 및 배포 What is 'undertow'? Ultralight & High Performance Web Server Provide NIO-based blocking / nonblocking API Implemented in Java, ava..