随笔分类 - LeetCode
摘要:Flatten Binary Tree to Linked List: Given a binary tree, flatten it to a linked list in-place. For example, Given 1 / \ ...
阅读全文
摘要:Next Permutation Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangem
阅读全文
摘要:Combination Sum Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C ...
阅读全文
摘要:Delete and Earn Given an array nums of integers, you can perform operations on the array. In each operation, you pick any nums[i] ...
阅读全文
摘要:Longest Palindromic Substring: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length ...
阅读全文
摘要:Letter Combinations of a Phone Number: Given a digit string, return all possible letter combinations that the number could represent....
阅读全文
摘要:Length of Last Word: Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of las...
阅读全文
摘要:Find Pivot: Given an array of integers nums, write a method that returns the “pivot” index of this array. We define the pivot inde...
阅读全文
摘要:Find Bottom Left Tree Value: Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Input: 2 ...
阅读全文
摘要:Maximum Length of Repeated Subarray: Given two integer arrays A and B, return the maximum length of an subarray that appears in both ...
阅读全文
摘要:Maximum Subarray: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For exa...
阅读全文
摘要:Reverse Words in a String: Given an input string, reverse the string word by word. For example, Given s = “the sky is blue”, r...
阅读全文
摘要:Implement strStr(): Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not pa...
阅读全文
摘要:Symmetric Tree: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this b...
阅读全文
摘要:3sum Closest: Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return...
阅读全文
摘要:Swap Nodes in Pairs: Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you ...
阅读全文
摘要:Remove Element: Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate...
阅读全文
摘要:Remove Duplicates from Sorted Array: Given a sorted array, remove the duplicates in place such that each element appear only once and...
阅读全文
摘要:Generate Parentheses: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For ...
阅读全文
摘要:Longest Substring Without Repeating Characters: Given a string, find the length of the longest substring without repeating characters...
阅读全文

浙公网安备 33010602011771号