문제 설명 https://leetcode.com/problems/bitwise-and-of-numbers-range 만약 주어진 입력이 아래와 같은 경우 5 7 5부터 7까지 bitwise AND 연산을 해서 나온 결과를 리턴하는 문제다. 즉 5 (0101)와 6(0110)을 Bitwise AND 연산을 하면 0100이 나온다. 0100에 7...
[Leet Code풀이] 201. Bitwise AND of Numbers Range
[Elasticsearch] Precautions when executing enrich policy
Purpose of Using Enrich In SQL, you can use Join to combine different tables and retrieve information from two tables at once. However, Elasticsearch does not support Join between multiple indexes...
[Leet Code풀이] 5. Longest Palindromic Substring
문제 설명 https://leetcode.com/problems/longest-palindromic-substring palindrom 이란 abc, aabaa, 우영우(?) 처럼 앞에서 읽으나 뒤에서 부터 읽으나 똑같은 문자열을 말한다. panlindrom을 찾으려니 세가지 케이스가 나왔다. Palindrom 찾기 Case 1. 중심 문자...
[Leet Code풀이] 413. Arithmetic Slices
문제 설명 https://leetcode.com/problems/arithmetic-slices/ arithmetic slice란 1,2,3,4 또는 -1, -3, -5 -7 처럼 같은 간격으로 3개 이상 이어진 숫자열을 의미한다. 일종의 Dynamic programming 문제인데, 규칙을 보면 아래와 같다. 1) 최대 arithmetic sli...
[Linux] Installation, Usage and Commands of tmux
tmux tmux stands for Terminal Multiplexer. When using Linux in the terminal, there can be inconvenience when sessions are disconnected, causing processes in progress to be interrupted or work to be...
[Linux] xargs command and usage example
Why use the xargs command? I wanted to utilize the output from certain commands to perform new commands in bulk. The xargs command has the ability to read a data stream and generate and execute a...
Haproxy
HA Proxy란 하드웨어 방식의 스위치의 기능을 대체하는 소프트웨어 로드 밸런서로 L4(TCP, UDP), L7(HTTP/HTTPS) 기능 및 로드 밸런싱 기능을 제공한다. 설치가 쉽고 빠르며 서비스 이중화(HA, High Availability)를 제공한다. 로드밸런싱이 왜 필요한가? 서버에 요청하는 클라이언트의 수가 많아지면 요청에 대한 응답을...
[Leet Code풀이] 90. Subsets 2
문제 설명 https://leetcode.com/problems/subsets-ii/ 주어진 리스트로 부터 가능한 모든 부분 집합을 구하는 문제다. 다만 입력에 중복값이 있기 때문에 출력 값에서도 이를 잘 처리해 주어야 한다. Subset 문제 문제에 추가적인 처리를 해주었는데, 먼저 [4,4,4,1], [4,1,4,4] 와 같은 처리를 위해...
[Leet Code풀이] 78. Subsets
문제 설명 https://leetcode.com/problems/subsets/ 주어진 리스트로 부터 가능한 모든 부분 집합을 구하는 문제다. DFS를 이용해 생성되는 경우의 수를 모두 구했다. 파이썬 알고리즘 인터뷰 책을 읽고 푼 문제라 코드가 같다. 풀이 class Solution: def subsets(self, nums: List[...
[Leet Code풀이] 117.Populating Next Right Pointers in Each Node II
문제 설명 https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/ 자세한 문제 설명은 위 링크 참고. 이진 트리의 각 노드의 next를 모두 오른쪽에 있는 노드를 가리키도록 변경하는 문제다. BFS를 적용하면 적어도 같은 레벨에 있는 노드에 대해서는 오른쪽 노드를 ...