Go, Vantage point
가까운 곳을 걷지 않고 서는 먼 곳을 갈 수 없다.
Github | https://github.com/overnew/
Blog | https://everenew.tistory.com/
문제 https://leetcode.com/problems/design-add-and-search-words-data-structure/ Design Add and Search Words Data Structure - LeetCode Can you solve this real interview question? Design Add and Search Words Data Structure - Design a data structure that supports adding new words and finding if a string matches any previously added string. Implement the WordDictionary class: * WordDictionar leetcode.c..
문제 https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/description/ Lowest Common Ancestor of a Binary Search Tree - LeetCode Can you solve this real interview question? Lowest Common Ancestor of a Binary Search Tree - Given a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST. According to the definition of LCA on Wikipedi..
문제 https://leetcode.com/problems/kth-smallest-element-in-a-bst/description/ Kth Smallest Element in a BST - LeetCode Can you solve this real interview question? Kth Smallest Element in a BST - Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree. Example 1: [https://assets.leetco leetcode.com 풀이 난이도: Medium..
문제 https://leetcode.com/problems/validate-binary-search-tree/description/ Validate Binary Search Tree - LeetCode Can you solve this real interview question? Validate Binary Search Tree - Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows: * The left subtree of a node contains only nodes with keys le leetcode.com 풀이 난이도: Medium ..
문제 https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/description/ Construct Binary Tree from Preorder and Inorder Traversal - LeetCode Can you solve this real interview question? Construct Binary Tree from Preorder and Inorder Traversal - Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is th..
문제 https://leetcode.com/problems/subtree-of-another-tree/description/ Subtree of Another Tree - LeetCode Can you solve this real interview question? Subtree of Another Tree - Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and false otherwise. A subtree of a bin leetcode.com 풀이 난이도: Easy 주어진 이진 sub..
문제 https://leetcode.com/problems/serialize-and-deserialize-binary-tree/description/ Serialize and Deserialize Binary Tree - LeetCode Can you solve this real interview question? Serialize and Deserialize Binary Tree - Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a n leetcode..
문제 https://leetcode.com/problems/binary-tree-level-order-traversal/description/ 풀이 난이도: Medium 세상 간단한 BFS 문제. BFS는 큐로 구현하므로 level과 TreeNode 두개를 pair로 만들어 큐에 넣어주자. 큐는 빌때까지 반복되면서 level에 맞는 vector에 value를 넣어주고, 하위 노드를 다시 큐에 삽입한다. 코드
문제 https://leetcode.com/problems/binary-tree-maximum-path-sum/description/ Binary Tree Maximum Path Sum - LeetCode Binary Tree Maximum Path Sum - A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequence at most once. Note that the path does not need to pass throu leetcode.com 풀이 난이도: Hard ..
문제 https://leetcode.com/problems/longest-palindromic-substring/description/ Longest Palindromic Substring - LeetCode Longest Palindromic Substring - Given a string s, return the longest palindromic substring in s. Example 1: Input: s = "babad" Output: "bab" Explanation: "aba" is also a valid answer. Example 2: Input: s = "cbbd" Output: "bb" Constraints: * 1