上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 43 下一页

2015年11月2日

43. Multiply Strings (String)

摘要: Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-neg 阅读全文

posted @ 2015-11-02 15:45 joannae 阅读(141) 评论(0) 推荐(0) 编辑

67. Add Binary

摘要: Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".class Solution {public: string addBinary(... 阅读全文

posted @ 2015-11-02 14:58 joannae 阅读(98) 评论(0) 推荐(0) 编辑

66. Plus One

摘要: 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 at... 阅读全文

posted @ 2015-11-02 14:55 joannae 阅读(169) 评论(0) 推荐(0) 编辑

2015年11月1日

65. Valid Number

摘要: Validate if a given string is numeric. Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended for the 阅读全文

posted @ 2015-11-01 20:47 joannae 阅读(183) 评论(0) 推荐(0) 编辑

2015年10月31日

50. Pow(x, n) (INT; Divide-and-Conquer)

摘要: Implement pow(x, n). 思路:二分法,将每次相乘,转化成平方。 阅读全文

posted @ 2015-10-31 08:43 joannae 阅读(128) 评论(0) 推荐(0) 编辑

2015年10月30日

149. Max Points on a Line (Array; Greedy)

摘要: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 思路:对于某一点来说,在经过该点的直线中选取节点数量最多的直线;对于全局来说,必定是某个局部点满足条 阅读全文

posted @ 2015-10-30 19:23 joannae 阅读(176) 评论(0) 推荐(0) 编辑

55. Jump Game (Array; Greedy)

摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim 阅读全文

posted @ 2015-10-30 19:15 joannae 阅读(197) 评论(0) 推荐(0) 编辑

87. Scramble String (String; DP)

摘要: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representati 阅读全文

posted @ 2015-10-30 18:59 joannae 阅读(271) 评论(0) 推荐(0) 编辑

115. Distinct Subsequences (String; DP)

摘要: Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a new string which is formed from t 阅读全文

posted @ 2015-10-30 06:29 joannae 阅读(187) 评论(0) 推荐(0) 编辑

2015年10月29日

72. Edit Distance (String; DP)

摘要: Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have 阅读全文

posted @ 2015-10-29 16:50 joannae 阅读(137) 评论(0) 推荐(0) 编辑

上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 43 下一页

导航