Minimum Absolute Difference in BST
LeetCode 530. Minimum Absolute Difference in BST 원문 Given the root of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree. ...
LeetCode 530. Minimum Absolute Difference in BST 원문 Given the root of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree. ...
LeetCode 153. Find Minimum in Rotated Sorted Array 원문 Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might b...
LeetCode 33. Search in Rotated Sorted Array 원문 There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at...
LeetCode 162. Find Peak Element 원문 A peak element is an element that is strictly greater than its neighbors. Given a 0-indexed integer array nums, find a peak element, and return its index. If th...
LeetCode 148. Sort List 원문 Given the head of a linked list, return the list after sorting it in ascending order. 연결 리스트와 병합 정렬 여기를 참고했다. 분할정복으로 쪼개고 비교하고 병합하고를 반복하는 거야 알겠지만 연결리스트에서 어떻게 중간을 찾는지 몰라...
LeetCode 20. Valid Parentheses 원문 Given a string s containing just the characters '(', ')', '{','}', '[' and ']', determine if the input string is valid. An input string is valid if: Open bra...
LeetCode 128. Longest Consecutive Sequence 원문 Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm that runs in O(...
LeetCode 202. Happy Number 원문 Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process. Starting with any positive integer, replace ...
LeetCode 49. Group Anagrams 원문 Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letter...
LeetCode 290. Word Pattern 원문 Given a pattern and a string s, find if s follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a ...