随笔分类 -  Google

上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
摘要:Divide two integers without using multiplication, division and mod operator. If it is overflow, return 2147483647 Example Given dividend = 100 and div 阅读全文
posted @ 2016-07-13 22:39 北叶青藤 阅读(167) 评论(0) 推荐(0)
摘要:Determine whether a Sudoku is valid. The Sudoku board could be partially filled, where empty cells are filled with the character .. Notice A valid Sud 阅读全文
posted @ 2016-07-13 12:02 北叶青藤 阅读(209) 评论(0) 推荐(0)
摘要:Valid Parentheses Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. Example The b 阅读全文
posted @ 2016-07-13 11:03 北叶青藤 阅读(260) 评论(0) 推荐(0)
摘要:Implement pow(x, n). Notice You don't need to care about the precision of your answer, it's acceptable if the expected answer and your answer 's diffe 阅读全文
posted @ 2016-07-13 10:43 北叶青藤 阅读(186) 评论(0) 推荐(0)
摘要:Given a boolean 2D matrix, find the number of islands. Notice 0 is represented as the sea, 1 is represented as the island. If two 1 is adjacent, we co 阅读全文
posted @ 2016-07-13 10:39 北叶青藤 阅读(234) 评论(0) 推荐(0)
摘要:Design a data structure that supports the following two operations: addWord(word) andsearch(word) search(word) can search a literal word or a regular 阅读全文
posted @ 2016-07-13 05:58 北叶青藤 阅读(254) 评论(0) 推荐(0)
摘要:Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... Notice Please complete the problem in-place. 阅读全文
posted @ 2016-07-12 23:56 北叶青藤 阅读(281) 评论(0) 推荐(0)
摘要:Check if two binary trees are identical. Identical means the two binary trees have the same structure and every identical position has the same value. 阅读全文
posted @ 2016-07-12 07:23 北叶青藤 阅读(256) 评论(0) 推荐(0)
摘要:Given a binary tree, return all root-to-leaf paths. Example Given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are: [ "1->2->5", "1 阅读全文
posted @ 2016-07-12 07:21 北叶青藤 阅读(174) 评论(0) 推荐(0)
摘要:A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 Given an encoded messag 阅读全文
posted @ 2016-07-12 02:45 北叶青藤 阅读(229) 评论(0) 推荐(0)
摘要:Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Example Given n = 12, retu 阅读全文
posted @ 2016-07-12 02:04 北叶青藤 阅读(250) 评论(0) 推荐(0)
摘要:House Robber You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constrain 阅读全文
posted @ 2016-07-12 00:26 北叶青藤 阅读(231) 评论(0) 推荐(0)
摘要:Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. Notice You must 阅读全文
posted @ 2016-07-11 21:39 北叶青藤 阅读(174) 评论(0) 推荐(0)
摘要:Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is a 阅读全文
posted @ 2016-07-10 23:04 北叶青藤 阅读(239) 评论(0) 推荐(0)
摘要:Invert a binary tree. Invert a binary tree. Invert a binary tree. Example 1 1 / \ / \ 2 3 => 3 2 / \ 4 4 1 /** 2 * Definition of TreeNode: 3 * public 阅读全文
posted @ 2016-07-10 12:32 北叶青藤 阅读(132) 评论(0) 推荐(0)
摘要:Implement int sqrt(int x). Compute and return the square root of x. Have you met this question in a real interview? Yes Example sqrt(3) = 1 sqrt(4) = 阅读全文
posted @ 2016-07-10 12:29 北叶青藤 阅读(203) 评论(0) 推荐(0)
摘要:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. Notice Bonus point if you 阅读全文
posted @ 2016-07-10 08:46 北叶青藤 阅读(204) 评论(0) 推荐(0)
摘要:Given an unsorted integer array, find the first missing positive integer. Example Given [1,2,0] return 3,and [3,4,-1,1] return 2. 分析: 我们只需要把1到A.length 阅读全文
posted @ 2016-07-09 12:24 北叶青藤 阅读(208) 评论(0) 推荐(0)
摘要:Implement a stack with min() function, which will return the smallest number in the stack. It should support push, pop and min operation all in O(1) c 阅读全文
posted @ 2016-07-09 07:59 北叶青藤 阅读(188) 评论(0) 推荐(0)
摘要:Given n, how many structurally unique BSTs (binary search trees) that store values 1...n? Given n, how many structurally unique BSTs (binary search tr 阅读全文
posted @ 2016-07-08 23:11 北叶青藤 阅读(183) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7 8 9 10 下一页