上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 53 下一页
摘要: Factory is a design pattern in common usage. Implement a ShapeFactory that can generate correct shape. You can assume that we have only tree different 阅读全文
posted @ 2016-07-12 06:37 北叶青藤 阅读(502) 评论(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 北叶青藤 阅读(223) 评论(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 北叶青藤 阅读(242) 评论(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 北叶青藤 阅读(229) 评论(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 北叶青藤 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Given two binary strings, return their sum (also a binary string). Example a = 11 b = 1 Return 100 分析: 这个和10进制加法一样。 total = a + b + carryover; digit = 阅读全文
posted @ 2016-07-10 23:51 北叶青藤 阅读(163) 评论(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 北叶青藤 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Given two array of integers(the first array is array A, the second array is arrayB), now we are going to find a element in array A which is A[i], and 阅读全文
posted @ 2016-07-10 12:45 北叶青藤 阅读(323) 评论(0) 推荐(0) 编辑
摘要: Write a method to replace all spaces in a string with %20. The string is given in a characters array, you can assume it has enough space for replaceme 阅读全文
posted @ 2016-07-10 12:39 北叶青藤 阅读(211) 评论(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 北叶青藤 阅读(118) 评论(0) 推荐(0) 编辑
上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 53 下一页