随笔分类 -  LeetCode

摘要:Flatten Binary Tree to Linked List: Given a binary tree, flatten it to a linked list in-place. For example, Given 1 / \ ... 阅读全文
posted @ 2018-04-08 11:39 liangf27 阅读(95) 评论(0) 推荐(0)
摘要:Next Permutation Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangem 阅读全文
posted @ 2018-04-04 21:41 liangf27 阅读(200) 评论(0) 推荐(0)
摘要:Combination Sum Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C ... 阅读全文
posted @ 2018-03-23 11:36 liangf27 阅读(121) 评论(0) 推荐(0)
摘要:Delete and Earn Given an array nums of integers, you can perform operations on the array. In each operation, you pick any nums[i] ... 阅读全文
posted @ 2017-12-28 20:37 liangf27 阅读(275) 评论(0) 推荐(0)
摘要:Longest Palindromic Substring: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length ... 阅读全文
posted @ 2017-12-27 15:51 liangf27 阅读(107) 评论(0) 推荐(0)
摘要:Letter Combinations of a Phone Number: Given a digit string, return all possible letter combinations that the number could represent.... 阅读全文
posted @ 2017-12-26 18:34 liangf27 阅读(126) 评论(0) 推荐(0)
摘要:Length of Last Word: Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of las... 阅读全文
posted @ 2017-12-17 00:00 liangf27 阅读(71) 评论(0) 推荐(0)
摘要:Find Pivot: Given an array of integers nums, write a method that returns the “pivot” index of this array. We define the pivot inde... 阅读全文
posted @ 2017-12-09 10:49 liangf27 阅读(78) 评论(0) 推荐(0)
摘要:Find Bottom Left Tree Value: Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Input: 2 ... 阅读全文
posted @ 2017-12-02 14:42 liangf27 阅读(76) 评论(0) 推荐(0)
摘要:Maximum Length of Repeated Subarray: Given two integer arrays A and B, return the maximum length of an subarray that appears in both ... 阅读全文
posted @ 2017-11-23 20:19 liangf27 阅读(111) 评论(0) 推荐(0)
摘要:Maximum Subarray: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For exa... 阅读全文
posted @ 2017-11-22 16:44 liangf27 阅读(122) 评论(0) 推荐(0)
摘要:Reverse Words in a String: Given an input string, reverse the string word by word. For example, Given s = “the sky is blue”, r... 阅读全文
posted @ 2017-11-08 00:00 liangf27 阅读(115) 评论(0) 推荐(0)
摘要:Implement strStr(): Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not pa... 阅读全文
posted @ 2017-10-31 21:45 liangf27 阅读(128) 评论(0) 推荐(0)
摘要:Symmetric Tree: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this b... 阅读全文
posted @ 2017-10-24 12:48 liangf27 阅读(79) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2017-10-16 17:08 liangf27 阅读(123) 评论(0) 推荐(0)
摘要: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 ... 阅读全文
posted @ 2017-10-09 23:44 liangf27 阅读(104) 评论(0) 推荐(0)
摘要:Remove Element: Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate... 阅读全文
posted @ 2017-10-03 20:08 liangf27 阅读(115) 评论(0) 推荐(0)
摘要:Remove Duplicates from Sorted Array: Given a sorted array, remove the duplicates in place such that each element appear only once and... 阅读全文
posted @ 2017-09-24 23:13 liangf27 阅读(103) 评论(0) 推荐(0)
摘要:Generate Parentheses: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For ... 阅读全文
posted @ 2017-09-17 21:03 liangf27 阅读(157) 评论(0) 推荐(0)
摘要:Longest Substring Without Repeating Characters: Given a string, find the length of the longest substring without repeating characters... 阅读全文
posted @ 2017-09-11 21:40 liangf27 阅读(102) 评论(0) 推荐(0)