摘要:https://leetcode.com/problems/minimum-window-substring/ Given a string S and a string T, find the minimum window in S which will contain all the chara
阅读全文
随笔分类 - LeetCode
摘要:https://leetcode.com/problems/text-justification/Given an array of words and a lengthL, format the text such that each line has exactlyLcharacters and...
阅读全文
摘要:https://leetcode.com/problems/valid-number/Validate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>t...
阅读全文
摘要:https://leetcode.com/problems/sqrtx/Implementint sqrt(int x).Compute and return the square root ofx.解题思路:这道题的题意是,算出最接近sqrt(x)的整数,正好等于或者略小于。这里注意的是,不能mi...
阅读全文
摘要:https://leetcode.com/problems/wildcard-matching/Implement wildcard pattern matching with support for'?'and'*'.'?' Matches any single character.'*' Mat...
阅读全文
摘要:https://leetcode.com/problems/multiply-strings/Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The nu...
阅读全文
摘要:https://leetcode.com/problems/largest-number/Given a list of non negative integers, arrange them such that they form the largest number.For example, g...
阅读全文
摘要:https://leetcode.com/problems/largest-rectangle-in-histogram/ Given n non-negative integers representing the histogram's bar height where the width of
阅读全文
摘要:https://leetcode.com/problems/lru-cache/Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following ope...
阅读全文
摘要:https://leetcode.com/problems/house-robber/ You are a professional robber planning to rob houses along a street. Each house has a certain amount of mo
阅读全文
摘要:https://leetcode.com/problems/happy-number/Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following ...
阅读全文
摘要:https://leetcode.com/problems/remove-linked-list-elements/Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 -...
阅读全文
摘要:https://leetcode.com/problems/binary-tree-maximum-path-sum/Given a binary tree, find the maximum path sum.The path may start and end at any node in th...
阅读全文
摘要:https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/ Given inorder and postorder traversal of a tree, construct t
阅读全文
摘要:https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/Given preorder and inorder traversal of a tree, construct the ...
阅读全文
摘要:https://leetcode.com/problems/recover-binary-search-tree/ Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without
阅读全文
摘要:https://leetcode.com/problems/number-of-islands/ Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrou
阅读全文
摘要:https://leetcode.com/problems/binary-tree-right-side-view/Given a binary tree, imagine yourself standing on therightside of it, return the values of t...
阅读全文
摘要:https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/ Given a binary tree, return the zigzag level order traversal of its nodes' val
阅读全文
摘要:https://leetcode.com/problems/surrounded-regions/ Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured
阅读全文

浙公网安备 33010602011771号