본문 바로가기

전체 글

(18)
Convert Sorted Array to Binary Search Tree 문제 링크 : https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/ Convert Sorted Array to Binary Search Tree - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 해설 : 모든 요소(elements)가 오름차순으로 정렬된 정수 배열 nums가 주어집니다. 이 배열을 높이가 균형 잡힌 이진 탐색 트리로 변환하세요. 높이가 균형 잡힌 이진 탐색 트리란..
Binary Tree Pruning 문제 링크 : https://leetcode.com/problems/binary-tree-pruning/ Binary Tree Pruning - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 해설 : 이진 트리의 root가 주어집니다. 같은 tree에서 1을 포함하지 않는 subtree를 제거하여 반환하세요. 제한 사항 1) tree의 node의 개수는 [1, 200]을 만족합니다. 2) Node.val은 0 또는 1입니다. 두 가지 방법으로 문제를 해결했..
Number of Matching Subsequences 문제 링크 : https://leetcode.com/problems/number-of-matching-subsequences/ Number of Matching Subsequences - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 해설 : 문자열 s와 문자열 배열 words가 주어집니다. 이 때 s의 subsequence를 만족하는 words[i]의 개수를 반환하는 함수를 작성하세요. (subsequence는 기존 문자열에서 순서를 바꾸지 않고 char..