일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- sorting
- dfs
- Array
- string
- 미디움
- list
- 쉬움
- binary search
- 중간
- binary tree
- DP
- 리트코드
- matrix
- easy
- hash table
- Binary
- Medium
- 문자열
- Python
- recursive
- 이진트리
- two pointers
- backtracking
- math
- leetcode
- 재귀
- HashTable
- linked list
- Depth-first Search
- tree
- Today
- Total
목록leetcode (78)
부부의 코딩 성장 일기
1. 문제 링크 Longest Substring Without Repeating Characters - LeetCode 2. 문제 설명 주어진 문자열에 포함된 문자열 중 중복된 문자가 없는 것 중 길이의 최댓값을 반환 예시) s = "abcabcbb"이면 "abc"가 가장 길기 때문에 3, s = "bbbbb"이면 "b"가 가장 길기 때문에 1, s = "pwwkew"이면 "wke"가 가장 길기 때문에 3 3. 처음 풀이 왼쪽을 고정 후 오른쪽은 한칸씩 이동하며 새로운 문자가 등장하면 현재 문자열을 temp에 저장 이미 나온 문자가 등장하면 왼쪽을 한칸 이동하고 temp를 비운 후 반복 temp를 비울 때 마다 이전까지 구한 최댓값 result와 현재 문자열 길이 중 최댓값으로 result 업데이트 매번..
1. 문제 링크 https://leetcode.com/problems/add-two-numbers/ Add Two Numbers - LeetCode Can you solve this real interview question? Add Two Numbers - You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and leetcode.com 2. 문제 설명 두 개의 연결리스트는 역순으로 된 숫자를 나타내고, 각 노드는 한 ..

1. 문제 링크 https://leetcode.com/problems/pascals-triangle-ii/ Pascal's Triangle II - LeetCode Can you solve this real interview question? Pascal's Triangle II - Given an integer rowIndex, return the rowIndexth (0-indexed) row of the Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it as shown: [https leetcode.com 2. 문제 설명 rowIndex 라는 정수가 주어졌을 때, Pas..
1. 문제 링크 https://leetcode.com/problems/path-sum/ Path Sum - LeetCode Can you solve this real interview question? Path Sum - Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals targetSum. A leaf is a node with no ch leetcode.com 2. 문제 설명 이진 트리 root와, 정수 targetSum가 주어졌을 때, root에서 leaf로 이어..
1. 문제 링크 https://leetcode.com/problems/balanced-binary-tree/ 2. 문제 설명 이진트리가 주어질 때, 이 트리가 height-balanced 되있는지에 따른 boolean을 반환 height-balanced의 정의 모든 노드의 두개의 subtree의 depth가 1개보다 더 차이나지 않는 이진트리 예시1) 아래 트리의 경우 루트 노드 3에 대해 subtree의 depth가 왼쪽 오른쪽 각각 1, 2이고 노드 9는 0,0, 노드 20은 각각 1,1로 depth가 1보다 더 차이나는 게 없으므로 True를 반환 3 / \ 9 20 / \ 15 7 예시2) 아래 트리의 경우 루트노드 1에 대해 subtree의 depth가 왼쪽 3, 오른쪽 1이기 때문에 1보다 더..
1. 문제 링크 https://leetcode.com/problems/maximum-depth-of-binary-tree/ Number of 1 Bits - LeetCode Can you solve this real interview question? Number of 1 Bits - Write a function that takes the binary representation of an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight [http://en.wikipedia.org/wiki/Hamming_w leetcode.com 2. 문제 설명 이진 트리 root가 주어졌을 때, 최대 ..
1. 문제 링크 Symmetric Tree - LeetCode Symmetric Tree - LeetCode Can you solve this real interview question? Symmetric Tree - Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center). Example 1: [https://assets.leetcode.com/uploads/2021/02/19/symtree1.jpg] Input: roo leetcode.com 2. 문제 설명 주어진 이진 트리가 가운데에 대하여 좌우 대칭인지 판단하는 문제 True인 예시 1 / \ 2 2 / \ / ..
1. 문제 링크 https://leetcode.com/problems/same-tree/ Same Tree - LeetCode Can you solve this real interview question? Same Tree - Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and the nodes have the leetcode.com 2. 문제 설명 이진 트리 p, q가 주어졌을 때, 두 트리가 같은 tree인지 판단 같다의 정의: 구조..