上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页

[leetcode]Anagrams

摘要: AnagramsGiven an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.编程珠玑中的一道题,书中的解法很巧妙,我就直接搬来用了,时... 阅读全文
posted @ 2014-08-01 19:56 喵星人与汪星人 阅读(359) 评论(0) 推荐(0) 编辑

[leetcode]Text Justification

摘要: Text JustificationGiven an array of words and a lengthL, format the text such that each line has exactlyLcharacters and is fully (left and right) just... 阅读全文
posted @ 2014-08-01 19:21 喵星人与汪星人 阅读(996) 评论(0) 推荐(0) 编辑

[leetcode]Single Number

摘要: Single NumberGiven an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runti... 阅读全文
posted @ 2014-08-01 00:52 喵星人与汪星人 阅读(121) 评论(0) 推荐(0) 编辑

[leetcode]Longest Palindromic Substring

摘要: Longest Palindromic SubstringGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there... 阅读全文
posted @ 2014-08-01 00:32 喵星人与汪星人 阅读(288) 评论(0) 推荐(0) 编辑

[leetcode]Climbing Stairs

摘要: Climbing StairsYou are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct way... 阅读全文
posted @ 2014-07-31 23:08 喵星人与汪星人 阅读(187) 评论(0) 推荐(0) 编辑

[leetcode]Longest Substring Without Repeating Characters

摘要: Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example, the ... 阅读全文
posted @ 2014-07-31 22:56 喵星人与汪星人 阅读(200) 评论(0) 推荐(0) 编辑

[leetcode]Longest Common Prefix

摘要: Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.算法思路:思路:貌似木有什么捷径,逐个比较,遇到不同即断开。代码如下: 1 publi... 阅读全文
posted @ 2014-07-31 21:52 喵星人与汪星人 阅读(179) 评论(0) 推荐(0) 编辑

[leetcode]Populating Next Right Pointers in Each Node II

摘要: Populating Next Right Pointers in Each Node IIFollow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any ... 阅读全文
posted @ 2014-07-31 20:40 喵星人与汪星人 阅读(174) 评论(0) 推荐(0) 编辑

[leetcode]Populating Next Right Pointers in Each Node

摘要: Populating Next Right Pointers in Each NodeGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLi... 阅读全文
posted @ 2014-07-31 20:35 喵星人与汪星人 阅读(246) 评论(0) 推荐(0) 编辑

[leetcode]Path Sum II

摘要: Path Sum IIGiven a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tr... 阅读全文
posted @ 2014-07-31 20:29 喵星人与汪星人 阅读(151) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页