1、题目名称 Compare Version Numbers(比较版本号) 2、题目地址 https://leetcode.com/problems/compare-version-numbers/ 3、题目内容 英文:Compare two version numbers version1 and version2. If version...
分类:
其他好文 时间:
2015-09-18 20:36:20
阅读次数:
136
题目来源:https://leetcode.com/problems/longest-common-prefix/题意分析: 这道题目是要写一个函数,找出字符串组strs的最长公共前缀子字符串。题目思路: 这都题目的难度是简单。从字符串头部开始计算,初始化公共前缀子字符串是strs[0],公共子.....
分类:
编程语言 时间:
2015-09-18 13:53:58
阅读次数:
177
题目来源:https://leetcode.com/problems/roman-to-integer/题意分析: 这道题目和上一题目相反,是将罗马数字转化成阿拉伯数字。题目思路: 只要知道罗马数字和阿拉伯数字之间是怎么转换的就可以了。先做一个字符和数值对应的字典,{'I':1,'V':5...
分类:
编程语言 时间:
2015-09-18 13:52:46
阅读次数:
205
1、题目名称 Plus One(数字加一) 2、题目地址 https://leetcode.com/problems/plus-one 3、题目内容 英文:Given a non-negative number represented as an array of digits, plus one to the number. The digi...
分类:
其他好文 时间:
2015-09-17 23:29:56
阅读次数:
409
题目来源:https://leetcode.com/problems/integer-to-roman/题意分析: 这道题是要把在区间[1-3999]的数字转化成罗马数字。题目思路: 只要知道了罗马数字和阿拉伯数字是怎么转换的就不难了,要注意的是900,500,400,90,50,40,9,...
分类:
编程语言 时间:
2015-09-17 23:06:34
阅读次数:
221
题目来源:https://leetcode.com/problems/container-with-most-water/题意分析: 给出一个n长度的非0数组,a1,a2,……,an,ai代表在坐标i上的高度为ai。以以ai,aj为高,i到j为底,可以构造出一个容器。那么求出这些容器中可以装的水.....
分类:
编程语言 时间:
2015-09-17 22:57:25
阅读次数:
222
在学习Spring框架的时候,遇到这样的问题,具体如下:使用MyEclipse10添加Spring框架支持时,applicationContext.xml文件出现小红叉解决方案:打开problems视图,选择对应的错误项,删除之。上述操作后效果:
分类:
移动开发 时间:
2015-09-17 19:55:35
阅读次数:
188
https://leetcode.com/problems/ugly-number-ii/刚开始,一看题以为用刷选法,但是当数据量大时明显不行。然后感觉用含2,3,5因子的个数当做进制来处理还是不行。最后看了提示,提示说这种数字相对增长快,所以只考虑这种数字,然后分成三组,按*2,*3,*5来取最小...
分类:
其他好文 时间:
2015-09-16 20:06:53
阅读次数:
156
https://leetcode.com/problems/valid-number/ 1 class Solution { 2 public: 3 bool isNumber(string s) { 4 while(!s.empty() && s[0] == ' ') { ...
分类:
其他好文 时间:
2015-09-16 14:05:16
阅读次数:
143
importnumpyasnp
#返回样本数据集
defloadDataSet():
postingList=[[‘my‘,‘dog‘,‘has‘,‘flea‘,‘problems‘,‘help‘,‘please‘],
[‘maybe‘,‘not‘,‘take‘,‘him‘,‘to‘,‘dog‘,‘park‘,‘stupid‘],
[‘my‘,‘dalmation‘,‘is‘,‘so‘,‘cute‘,‘I‘,‘love‘,‘him‘],
[‘stop‘,‘posting‘,‘stupid‘,..
分类:
编程语言 时间:
2015-09-16 01:02:17
阅读次数:
228