1. 끝단은 무조건 같은 숫자로 구성된 subtree가 된다. 2. 문제는 어떤 변수를 전역으로 둘 것인가이다. 2-1 같은 숫자로 구성된 subtree를 찾으려면 현재 어떤 숫자인지를 우선 가지고 있어야 하고 2-2 현 위치에서 아래의 트리가 같은 숫자로 구성되어 있는지 상태값을 가져야 한다. 2-3 현재까지 몇개의 서브트리를 찾았는지도 알아야 한다. 3. 쉽게 빠지는 유혹은 반환값을 서브트리 판단으로 1을 올리거나 안올리거나를 하고 싶은 유혹이 든다. 그렇게 되면 현 시점에 하위 트리에 대한 정보를 전역으로 보관해야 한다. 3-1 해결이 힘들다. 4. 결론적으로 말하면 재귀적으로 현재 하위 트리가 같은 숫자로 구성된 서브트리인지 true, false를 반환하고, 서브트리 숫자를 전역으로 가지는 것이 ..
1. 동일한 Tree의 PreOrder, InOrder traverse의 결과가 담겨진 배열 2개가 주어질 때 Binary Tree를 만드는 문제이다. 2. 기본적으로 두개의 다른 Traverse 결과가 있으면 바이너리 트리를 만드는 알고리즘은 혼자서 찾기힘들기 때문에 기본적으로 인지하고 있는 것이 중요하다. -> 기본지식 (모르면 인터뷰에서 풀 수 없다.) 3. 문제는 잘 알려진 이 알고리즘을 어떻게 구현할지인데 상당히 까다롭다. 4. 재귀를 사용하여 문제를 풀 때는 Top down과 Botton up 둘 중 하는 사용하는데 일반적으로는 Botton up이 훨씬 직관적이고 많이 사용된다. 5. 이 문제는 Top down 방식을 사용하여 문제를 해결해야 편리하다. 익숙하지 않기 때문에 어려운 것이다. 5..
Robot Bounded In Circle - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1. 이 문제는 사실 기술적인 부분이 하나도 없다. 알고리즘을 몰라도 구현 가능한 문제이다. 2. 그런데 웃긴 건 아직도 이 문제의 해답을 이해하지 못하겠다는 점이다. 3. 문제의 핵심은 이 로봇이 벋어나지 못하는 경로를 계속해서 돌게 되는지 여부인데 이 조건에 대해서 이해 할 수가 없다. 4. 조건은 로봇에게 지시문이 주어지는데 이것을 무한히 반복하여 동작하게 된다. ..

1. 이 문제는 알고리즘에 관한 내용으로 깊은 생각을 요구한다. Share A string S of lowercase English letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one part, and return a list of integers representing the size of these parts. Example 1: Input: S = "ababcbacadefegdehijhklij" Output: [9,7,8] Explanation: The partition is "ababcbaca", "defegde", "hijhk..

0. 사용된 lambda는 0-1 정렬을 위하여 sorted(Comparator)를 사용하였다. 0-2 toArray는 배열을 생성하는데 내부적으로 IntFunction을 인자로 받는다. 0-2-1 IntFunction은 하나의 int 값을 인자로 받아 특정타입을 반환하는 함수이다. 0-2-2 보통 인자는 생성할 배열의 크기가 되고 여기서는 new 메소드로 타입을 지정한다. 1. 이 문제는 정렬에 대한 문제이다. 937. Reorder Data in Log Files You have an array of logs. Each log is a space delimited string of words. For each log, the first word in each log is an alphanumeric ..

1. 배열 안에 섬이 몇 개인지를 찾는 문제이다. 200. Number of Islands Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water. Example 1: Input: grid = [ ["1","1","1","1","0"], ["1","1","0","1","0"], ["1","1","0","0",..

0. 사용된 lambda 0-1 limit 처음 몇 개를 컷 0-2 filter true 조건만 통과 0-3 sorted 알파벳 순 정렬 1. 이 문제도 String을 다루는 법에 대한 문제이다. Given an array of strings products and a string searchWord. We want to design a system that suggests at most three product names from products after each character of searchWord is typed. Suggested products should have common prefix with the searchWord. If there are more than three produ..

0. 사용된 lambda 0-1 int[][] 를 List로 변환 0-2 map 내부에서 int[] 를 List로 변환한다. 0-2-1 boxed를 사용하여 wrapping을 해야 한다. 0-2-2 Arrays.stream(int[])은 IntStream을 반환하는데 각 int값이 List에 들어가려면 boxed가 필요하다. 0-3 boolean[]을 Boolean[]로 변환하기 위해서는 꼼수를 써야한다. 0-3-1 IntStream.range를 통해 배열개수를 정하고, mapToObj를 통해 index로 Wrapper를 만든다. 0-3-2 range의 인자는 첫번째는 포함, 두번째는 불포함이라서 0과 배열 length를 넘기면 된다. 0-3-3 mapToObj를 자동으로 primitive type의 w..
- Total
- Today
- Yesterday
- 도커 개발환경 참고
- AWS ARN 구조
- Immuability에 관한 설명
- 자바스크립트 멀티 비동기 함수 호출 참고
- WSDL 참고
- SOAP 컨슈머 참고
- MySql dump 사용법
- AWS Lambda with Addon
- NFC 드라이버 linux 설치
- electron IPC
- mifare classic 강의
- go module 관련 상세한 정보
- C 메모리 찍어보기
- C++ Addon 마이그레이션
- JAX WS Header 관련 stackoverflow
- SOAP Custom Header 설정 참고
- SOAP Custom Header
- SOAP BindingProvider
- dispatcher 사용하여 설정
- vagrant kvm으로 사용하기
- git fork, pull request to the …
- vagrant libvirt bridge network
- python, js의 async, await의 차이
- go JSON struct 생성
- Netflix Kinesis 활용 분석
- docker credential problem
- private subnet에서 outbound IP 확…
- 안드로이드 coroutine
- kotlin with, apply, also 등
- 안드로이드 초기로딩이 안되는 경우
- navigation 데이터 보내기
- 레이스 컨디션 navController
- raylib
- spring boot
- mapping
- Security
- Spring Security
- one-to-one
- login
- Spring
- form
- Validation
- MYSQL
- Angular
- 자바
- WebMvc
- hibernate
- crud
- 외부파일
- 로그인
- XML
- one-to-many
- Many-To-Many
- 스프링부트
- 설정
- Rest
- jsp
- 하이버네이트
- 스프링
- 매핑
- 설정하기
- RestTemplate
- 상속