일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- DP
- binary tree
- backtracking
- matrix
- binary search
- dfs
- 재귀
- 쉬움
- 문자열
- easy
- 이진트리
- Depth-first Search
- sorting
- recursive
- two pointers
- math
- Array
- Binary
- linked list
- Python
- tree
- 리트코드
- Medium
- 중간
- string
- HashTable
- hash table
- 미디움
- list
- leetcode
- Today
- Total
목록bit manipulation (4)
부부의 코딩 성장 일기
1. 문제 링크 https://leetcode.com/problems/single-number-ii/description/ Single Number II - LeetCode Can you solve this real interview question? Single Number II - Given an integer array nums where every element appears three times except for one, which appears exactly once. Find the single element and return it. You must implement a solution with a lin leetcode.com 2. 문제 설명 정수로 구성된 array nums가 주어졌을..
1. 문제 링크 https://leetcode.com/problems/power-of-two/description/ 2. 문제 설명 정수 n이 주어졌을 때, 만약 해당 수가 2의 거듭제곱이면 True를 아니면 False를 반환 예시1) n=1일 때, 1은 2의 0 거듭제곱이므로 True 반환 예시2) n=16일 때, 16은 2의 4 거듭제곱이므로 True 반환 예시3) n=3일 때, 3은 2의 거듭제곱이 아니므로 False를 반환 3. 처음 풀이 Follow up에서 loops나 recursion을 쓰지 않고, 풀 수 있는지를 물어봐서 다른 방법을 생각해보다가, 10진법을 2진법으로 바꾸었을 때, 2의 거듭제곱이라면 10000, 100, 10 등의 형태일 것이기 때문에, 1을 제외한 값을 int로 변환했..
1. 문제 링크 https://leetcode.com/problems/gray-code/description/ Gray Code - LeetCode Can you solve this real interview question? Gray Code - An n-bit gray code sequence is a sequence of 2n integers where: * Every integer is in the inclusive range [0, 2n - 1], * The first integer is 0, * An integer appears no more than once in the sequence, leetcode.com 2. 문제 설명 n-bit gray code sequence는 아래 조건을 만족하..
1. 문제 링크 https://leetcode.com/problems/reverse-bits/ Reverse Bits - LeetCode Can you solve this real interview question? Reverse Bits - Reverse bits of a given 32 bits unsigned integer. Note: * Note that in some languages, such as Java, there is no unsigned integer type. In this case, both input and output will be given as a signed leetcode.com 2. 문제 설명 주어진 정수를 2진법으로 나타낸 후 이를 앞뒤 역순으로 뒤집은 수를 10진법..