- 博客(103)
- 资源 (7)
- 收藏
- 关注
原创 Leetocode之Find Duplicate File in System 问题
问题描述:Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups of duplicate files in the file system in terms
2017-10-11 20:43:42
474
原创 Leetcode之Edit Distance 问题
问题描述:Given two words word1 and word2, find the minimum number of steps required to convertword1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted on
2017-10-11 17:18:55
548
原创 Leetcode之Distinct Subsequences 问题
问题描述:Given a string S and a string T, count the number of distinct subsequences of S whichequals T. A subsequence of a string is a new string which is formed from the original string bydeletin
2017-10-11 15:56:30
657
原创 Leetcode之Delete Operation for Two Strings 问题
问题描述:Given two words word1 and word2, find the minimum number of steps required to makeword1 and word2 the same, where in each step you can delete one character in either string.
2017-10-10 10:53:16
437
原创 Leetcode之Detect Capital 问题
问题描述:Given a word, you need to judge whether the usage of capitals(大写字母) in it is right or not.We define the usage of capitals in a word to be right when one of the following cases holds:A
2017-10-10 10:43:15
264
原创 Leetcode之Decode Ways 问题
问题描述:A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the tot
2017-10-10 09:50:07
344
原创 Leetcode之Count and Say 问题
问题描述:The count-and-say sequence is the sequence of integers with the first five terms as following:1. 12. 113. 214. 12115. 1112211 is read off as "one 1" or11.11 i
2017-10-10 09:21:53
375
原创 Leetcode之Construct String from Binary Tree 问题
问题描述:You need to construct a string consists of parenthesis and integers from a binary tree with thepreorder traversing way.The null node needs to be represented by empty parenthesis pair "()"
2017-10-07 20:26:18
246
原创 Leetcode之Valid Palindrome 问题
问题描述:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.Note:Have you consider that the string might be empty? This is a good question t
2017-10-05 21:50:10
275
原创 Leetcode之Rotate List 问题
问题描述:Given a list, rotate the list to the right by k places, where k is non-negative.示例:For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.题目来源:Rotate List (详细地址:ht
2017-10-05 21:25:47
278
原创 Leetcode之Reverse Vowels of a String 问题
问题描述:Write a function that takes a string as input and reverse only the vowels of a string.Note:The vowels does not include the letter "y".示例一:Given s = "hello", return "holle".示例二:Given
2017-10-05 21:08:51
286
原创 Leetcode之Reverse String 问题
问题描述:Write a function that takes a string as input and returns the string reversed.示例:Example:Given s = "hello", return "olleh".问题来源:Reverse String (详细地址:https://leetcode.com/problems/revers
2017-10-05 19:18:45
302
原创 Leetcode之Remove Nth Node From End of List 问题
问题描述:Given a linked list, remove the nth node from the end of list (倒数第n个结点)and return its head.Note:Given n will always be valid.Try to do this in one pass.示例:Given linked list: 1->2->3->
2017-10-05 15:43:44
291
原创 Leetcode之Partition List 问题
问题描述:Given a linked list and a value x, partition it such that all nodes less thanx come before nodes greater than or equal to x. You should preserve the original relative order of the nodes i
2017-10-05 15:14:00
291
原创 Leetcode之Palindrome Linked List 问题
问题描述:Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?示例:1->2->9->4->9->2->1 return true;1->2->2->1 return tr
2017-10-05 10:21:05
221
原创 Leetcode之Longest Word in Dictionary through Deleting 问题
问题描述:Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. If there are more than one possible results
2017-10-05 09:46:52
316
原创 Leetcode之Longest Substring Without Repeating Characters 问题
问题描述:Given a string, find the length of the longest substring without repeating characters.示例:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b", wit
2017-10-05 09:09:25
238
原创 Leetcode之Permutation in String 问题
问题描述:Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's permutations is the substring of the second string.
2017-10-02 15:54:56
340
原创 Leetcode之Intersection of Two Arrays II 问题
问题描述:Given two arrays, write a function to compute their intersection. Note:Each element in the result should appear as many times as it shows in both arrays.The result can be in any order
2017-09-30 17:17:18
261
原创 Leetcode之Intersection of Two Arrays 问题
问题描述:Given two arrays, write a function to compute their intersection(交集). Note:Each element in the result must be unique.The result can be in any order.示例:Example:Given nums1 = [1,
2017-09-30 16:36:05
351
原创 Leetcode之Linked List Cycle II 问题
问题描述:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull. Note: Do not modify the linked list.Follow up:Can you solve it without using extra space?
2017-09-30 15:57:13
222
原创 Leetcode之Linked List Cycle 问题
问题描述:Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 问题来源:Linked List Cycle (详细地址:https://leetcode.com/problems/linked-list-cycle/
2017-09-30 15:19:57
222
原创 Leetcode之Implement strStr() 问题
问题描述:Implement strStr(). Returns the index of the first occurrence of needle(针) in haystack(干草堆), or -1 if needle is not part of haystack.题目来源:Implement strStr() (详细地址:https://leetcode.com/pro
2017-09-28 22:28:22
178
原创 Leetcode之Word Search 问题
问题描述:Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vert
2017-09-24 21:04:38
334
原创 Leetcode之Valid Triangle Number 问题
问题描述:Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle.No
2017-09-24 20:45:47
304
原创 Leetcode之Unique Paths II 问题
问题描述:Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectively in t
2017-09-24 20:16:52
220
原创 Leetcode之Two Sum II - Input array is sorted 问题
问题描述:Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two
2017-09-24 20:09:59
229
原创 Leetcode之Triangle 问题
问题描述:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.Note:Bonus point if you are able to do this using only O(n) extra
2017-09-24 19:26:55
401
原创 Leetcode之Third Maximum Number 问题
问题描述:Given a non-empty array of integers, return the third maximum number in this array.If it does not exist, return the maximum number. The time complexity must be in O(n).示例一:Input: [3, 2, 1]
2017-09-24 19:11:18
416
原创 Leetcode之Teemo Attacking 问题
问题描述: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 attackingascending time series towards Ashe and the poiso
2017-09-24 16:57:08
245
原创 Leetocode之Task Scheduler 问题
问题描述:Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks.Tasks could be done without original order. Each tas
2017-09-24 16:20:14
248
原创 Leetcode之Summary Ranges 问题
问题描述:Given a sorted integer array without duplicates, return the summary of its ranges.示例一:Input: [0,1,2,4,5,7]Output: ["0->2","4->5","7"]示例二:Input: [0,2,3,4,6,8,9]Output: ["0","2->4","6
2017-09-24 15:55:55
210
原创 Leetcode之Subsets II 问题
问题描述:Given a collection of integers that might contain duplicates,nums, return all possible subsets.Note: The solution set must not contain duplicate subsets. 示例:For example,If nums = [1,2
2017-09-24 15:22:55
192
原创 Leetcode之Subsets 问题
问题描述:Given a set of distinct integers, nums, return all possible subsets.Note: The solution set must not contain duplicate subsets.示例:For example,If nums = [1,2,3], a solution is: [ [3]
2017-09-24 14:41:30
288
原创 Leetcode之Subarray Sum Equals K问题
问题描述:Given an array of integers and an integer k, you need to find the total number ofcontinuous subarrays whose sum equals to k.Note:The length of the array is in range [1, 20,000].The ra
2017-09-23 21:41:47
511
原创 Leetcode之 Spiral Matrix 问题
问题描述:Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.示例:[[ 1, 2, 3 ],[ 4, 5, 6 ],[ 7, 8, 9 ]]You should return [1,2,3,6,9,8,7,4,
2017-09-23 20:27:24
278
原创 Leetcode之Sort Colors 问题
问题描述:Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with thecolors in the order red, white and blue. Here, we will use the in
2017-09-23 17:04:52
275
原创 Leetcode之Shortest Unsorted Continuous Subarray 问题
问题描述:Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order, too.You ne
2017-09-23 16:23:58
171
原创 Leetcode之Set Matrix Zeroes 问题
问题描述:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. Follow up: Did you use extra space?A straight forward solution using O(mn) space is probably
2017-09-23 15:57:48
249
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人