Leetcode 279

[Binary Search][Easy] 374. Guess Number Higher or Lower

https://leetcode.com/problems/guess-number-higher-or-lower/description Guess Number Higher or Lower - LeetCode Can you solve this real interview question? Guess Number Higher or Lower - We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wrong, I will tell you whether the leetcode.com Q. 1-n까지의 수 중 하나를 ..

Leetcode/LeetCode75 2024.01.09

[Heap/Priority Queue][Medium] 2542. Maximum Subsequence Score

https://leetcode.com/problems/maximum-subsequence-score Maximum Subsequence Score - LeetCode Can you solve this real interview question? Maximum Subsequence Score - You are given two 0-indexed integer arrays nums1 and nums2 of equal length n and a positive integer k. You must choose a subsequence of indices from nums1 of length k. For chosen indic leetcode.com Q. 길이가 같은 두개의 배열과 양수 k 가 주어질 때, 두 배..

Leetcode/LeetCode75 2024.01.06

[Heap/Priority Queue][Medium] 2336. Smallest Number in Infinite Set

https://leetcode.com/problems/smallest-number-in-infinite-set/description Smallest Number in Infinite Set - LeetCode Can you solve this real interview question? Smallest Number in Infinite Set - You have a set which contains all positive integers [1, 2, 3, 4, 5, ...]. Implement the SmallestInfiniteSet class: * SmallestInfiniteSet() Initializes the SmallestInfiniteSet obj leetcode.com Q. 모든 양의 정수..

Leetcode/LeetCode75 2024.01.03

[Heap/Priority Queue][Medium] 215. Kth Largest Element in an Array

https://leetcode.com/problems/kth-largest-element-in-an-array/description Kth Largest Element in an Array - LeetCode Can you solve this real interview question? Kth Largest Element in an Array - Given an integer array nums and an integer k, return the kth largest element in the array. Note that it is the kth largest element in the sorted order, not the kth distinct eleme leetcode.com Q. 해당 주어진 배..

Leetcode/LeetCode75 2024.01.02

[Binary Search Tree][Medium] 450. Delete Node in a BST

https://leetcode.com/problems/delete-node-in-a-bst/description Q. 주어진 BST에서 특정 값인 노드를 삭제하라. Solution. 2진트리 삭제 연산 코딩을 확인하는 문제이다. 2진 트리의 특성을 유지하면서 특정 노드를 삭제하라면, 대상 노드를 삭제하고 어떤 노드를 삭제된 노드의 자리에 위치케 할지를 결정하는지가 알고리즘의 핵심이라 하겠다. 연산 자체는 이런 식이다. 2진 트리에서, 특정 노드를 제거하면, > 노드의 좌측 사이드에서 제일 큰 값을 가진 노드, 혹은 > 우측 사이드에서 가장 작은 값을 가진 노드 를 해당 삭제된 노드 자리에 위치하면 해당 트리의 특성이 유지된다. 따라서 해당 문제를 풀기 위해서는 > 특정 노드 탐색 > 특정 노드 기준, c..

Leetcode/LeetCode75 2023.12.31

[Binary Search Tree][Easy] 700. Search in a Binary Search Tree

https://leetcode.com/problems/search-in-a-binary-search-tree/description Search in a Binary Search Tree - LeetCode Can you solve this real interview question? Search in a Binary Search Tree - You are given the root of a binary search tree (BST) and an integer val. Find the node in the BST that the node's value equals val and return the subtree rooted with that node. If leetcode.com Q. 주어진 Binary..

Leetcode/LeetCode75 2023.12.30

[Binary Tree-BFS][Medium] 1161. Maximum Level Sum of a Binary Tree

https://leetcode.com/problems/maximum-level-sum-of-a-binary-tree/description Maximum Level Sum of a Binary Tree - LeetCode Can you solve this real interview question? Maximum Level Sum of a Binary Tree - Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on. Return the smallest level x such that the sum of all the values of node leetcode.com Q. 주어..

Leetcode/LeetCode75 2023.12.28

[Binary Tree-BFS][Medium] 199. Binary Tree Right Side View

https://leetcode.com/problems/binary-tree-right-side-view/description Binary Tree Right Side View - LeetCode Can you solve this real interview question? Binary Tree Right Side View - Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. Example 1: [https://asse leetcode.com Q. 주어진 tree 에서 가장 우측 노..

Leetcode/LeetCode75 2023.12.28

[Binary Tree-DFS][Medium] 236. Lowest Common Ancestor of a Binary Tree

https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/description Lowest Common Ancestor of a Binary Tree - LeetCode Can you solve this real interview question? Lowest Common Ancestor of a Binary Tree - Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia [https://en.wikipedia.org/wiki/ leetcode..

Leetcode/LeetCode75 2023.12.27

[Binary Tree-DFS][Medium] 1372. Longest ZigZag Path in a Binary Tree

https://leetcode.com/problems/longest-zigzag-path-in-a-binary-tree/description Longest ZigZag Path in a Binary Tree - LeetCode Can you solve this real interview question? Longest ZigZag Path in a Binary Tree - You are given the root of a binary tree. A ZigZag path for a binary tree is defined as follow: * Choose any node in the binary tree and a direction (right or left). * If the leetcode.com Q..

Leetcode/LeetCode75 2023.12.26