上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页

[LeetCode] Balanced Binary Tree Solution

摘要: Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth... 阅读全文
posted @ 2013-01-17 14:47 小刀初试 阅读(176) 评论(0) 推荐(0)

[LeetCode] Best Time to Buy and Sell Stock III Solution

摘要: Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complet... 阅读全文
posted @ 2013-01-17 13:52 小刀初试 阅读(133) 评论(0) 推荐(0)

[LeetCode] Best Time to Buy and Sell Stock II Solution

摘要: Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complet... 阅读全文
posted @ 2013-01-17 13:22 小刀初试 阅读(147) 评论(0) 推荐(0)

[LeetCode] Best Time to Buy and Sell Stock Solution

摘要: Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction ... 阅读全文
posted @ 2013-01-17 12:48 小刀初试 阅读(155) 评论(0) 推荐(0)

[LeetCode] Anagrams 解题报告

摘要: Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.» Solve this problem[解题思路]对每一个字符串取水印,... 阅读全文
posted @ 2013-01-16 13:50 小刀初试 阅读(214) 评论(0) 推荐(0)

[LeetCode] Add Binary 解题报告

摘要: Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".» Solve this problem[解题思路]典型的实现题。没什么可说的。[Cod... 阅读全文
posted @ 2013-01-16 12:19 小刀初试 阅读(148) 评论(0) 推荐(0)

[LeetCode] ZigZag Conversion 解题报告

摘要: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font ... 阅读全文
posted @ 2013-01-15 11:29 小刀初试 阅读(187) 评论(0) 推荐(0)

[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 "adjace... 阅读全文
posted @ 2013-01-15 10:21 小刀初试 阅读(141) 评论(0) 推荐(0)

[LeetCode] Wildcard Matching, Solution

摘要: Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including th... 阅读全文
posted @ 2013-01-13 14:43 小刀初试 阅读(139) 评论(0) 推荐(0)

[LeetCode] Validate Binary Search Tree 解题报告

摘要: Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n... 阅读全文
posted @ 2013-01-13 13:42 小刀初试 阅读(260) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页