随笔分类 - LeetCode
摘要:On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once you pay the cost, you can either climb one or two steps. Y
        阅读全文
                
摘要:Given a Binary Search Tree (BST) with the root node root, return the minimum difference between the values of any two different nodes in the tree. Exa
        阅读全文
                
摘要:Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette
        阅读全文
                
摘要:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Remov
        阅读全文
                
摘要:Find the largest palindrome made from the product of two n-digit numbers. Since the result could be very large, you should return the largest palindro
        阅读全文
                
摘要:Shuffle a set of numbers without duplicates. Example:
        阅读全文
                
摘要:Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the roo
        阅读全文
                
摘要:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia
        阅读全文
                
摘要:Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a
        阅读全文
                
摘要:Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. 
        阅读全文
                
摘要:Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is d
        阅读全文
                
摘要:Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all 
        阅读全文
                
摘要:S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sorted in some custom order previously. We want to per
        阅读全文
                
摘要:Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except 
        阅读全文
                
摘要:Given two integers n and k, you need to construct a list which contains n different positive integers ranging from 1 to n and obeys the following requ
        阅读全文
                
摘要:In LOL world, there is a hero called Teemo and his attacking can make his enemy Ashe be in poisoned condition. Now, given the Teemo's attacking ascend
        阅读全文
                
摘要:We are given two strings, A and B. A shift on A consists of taking string A and moving the leftmost character to the rightmost position. For example, 
        阅读全文
                
摘要:There are 1000 buckets, one and only one of them contains poison, the rest are filled with water. They all look the same. If a pig drinks that poison 
        阅读全文
                
摘要:Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase English letters only and the
        阅读全文
                
摘要:An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535). Given a coordinate (sr, 
        阅读全文
                
 
                    
                
 浙公网安备 33010602011771号
浙公网安备 33010602011771号