- 博客(14)
- 收藏
- 关注
原创 [leetcode][hash] Anagrams
题目;Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.v1 76msclass Solution {public: //将单词按字母顺序排序后作为hash的key,字符串在strs中的
2015-06-30 15:46:09 270
原创 [leetcode][回溯] Combinations
题目:Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,4], [2,3], [1,2], [1,3],
2015-06-30 11:58:24 234
原创 [leetcode][回溯][DP] Palindrome Partitioning //TODO
题目:Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s = "aab",Return [
2015-06-30 09:38:29 258
原创 [leetcode][math] Basic Calculator II
题目:Implement a basic calculator to evaluate a simple expression string.The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer divisi
2015-06-29 21:38:37 302
原创 [leetcode][array] Summary Ranges
题目:Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].class Solution {public://注意对负数的处理//注意进行
2015-06-29 18:17:44 226
原创 [leetcode][math] Basic Calculator
题目:Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closing parentheses ), the plus + or minus sign -, non-negative integers
2015-06-13 18:10:36 354
原创 [leetcode][math] Rectangle Area
题目:Find the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corner and top right corner as shown in the figure.Assume that
2015-06-13 09:51:31 224
原创 [leetcode][DP] House Robber II
题目;Note: This is an extension of House Robber.After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention.
2015-06-07 19:01:11 342
原创 [leetcode][tree] Count Complete Tree Nodes
题目:Given a complete binary tree, count the number of nodes./** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; *
2015-06-07 17:19:43 331
原创 [leetcode][math] Factorial Trailing Zeroes
题目;Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.class Solution {public:/*n!=1*2*3*4*5*6*7*8*9*10*11...*(n-1
2015-06-02 12:06:13 378
原创 [leetcode][贪心] Gas Station
题目:There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from stat
2015-06-02 11:56:18 345
原创 [leetcode][DP][回溯] Word Break II
题目:Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences.For example, giv
2015-06-01 22:51:52 285
原创 [leetcode][DP] Word Break
题目:Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict
2015-06-01 21:07:24 232
原创 [leetcode][sort] Largest Number
题目:Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.Note: The result
2015-06-01 19:18:48 248
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人