码迷,mamicode.com
首页 >  
搜索关键字:integer    ( 14932个结果)
[LeetCode]40 Combination Sum II
https://oj.leetcode.com/problems/combination-sum-ii/http://blog.csdn.net/linhuanmars/article/details/20829099publicclassSolution{ publicList<List<Integer>>combinationSum2(int[]num,inttarget) { if(num==null||num.length==0) returnCollections.empty..
分类:其他好文   时间:2015-01-03 08:12:50    阅读次数:185
Excel Sheet Column Title (STRING - TYPE CONVERTION)
QUESTIONGiven a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... ...
分类:其他好文   时间:2015-01-03 08:10:42    阅读次数:166
Leetcode: Factorial Trailing Zeroes
Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. 解析: 只有2和5相乘才会出现0,其中整十也可以看做是2和5相乘的结果,所以,可以在n之前看看有多少个2以及多少个5就行了,又发现2的数量...
分类:其他好文   时间:2015-01-02 22:28:57    阅读次数:213
GetStr: 一个自创蛮有用的字符串函数~
作用:用于截取一个字符串中,两个标识符中间的字符串。     Public Function GetStr(ByVal InputString As String, ByVal String1 As String, ByVal String2 As String) As String         Dim i As Integer         Dim j As Inte...
分类:其他好文   时间:2015-01-02 19:58:34    阅读次数:339
[LeetCode]46 Permutations
https://oj.leetcode.com/problems/permutations/http://fisherlei.blogspot.com/2012/12/leetcode-permutations.htmlTODOseesubsetcombination,nextpublicclassSolution{ //Assumesallinputnumbersareunique publicList<List<Integer>>permute(int[]num){ retur..
分类:其他好文   时间:2015-01-02 16:17:16    阅读次数:126
[LeetCode]8 String to Integer (atoi)
https://oj.leetcode.com/problems/string-to-integer-atoi/http://fisherlei.blogspot.com/2013/01/leetcode-string-to-integer-atoi.htmlpublicclassSolution{ publicintatoi(Stringstr){ //Validations if(str==null||str.length()==0) return0; char[]chars=str.trim()...
分类:其他好文   时间:2015-01-02 16:14:54    阅读次数:157
[LeetCode]1 Reverse Integer
http://7371901.blog.51cto.com/user_index.php?action=addblog_newhttp://fisherlei.blogspot.com/2012/12/leetcode-reverse-integer.htmlpublicclassSolution{ publicintreverse(intx){ //SolutionA //returnreverse_Mod(x); //SolutionB returnreverse_String(x); } ////..
分类:其他好文   时间:2015-01-02 16:14:15    阅读次数:223
[LeetCode]12 Integer to Roman
https://oj.leetcode.com/problems/integer-to-roman/http://fisherlei.blogspot.com/2012/12/leetcode-integer-to-roman.htmlpublicclassSolution{ // //把4,9定义为特殊的字符 //从大到小适配 publicStringintToRoman(intnum){ if(num<1||num>3999) returnnull;//Inva..
分类:其他好文   时间:2015-01-02 16:14:07    阅读次数:128
[LeetCode]13 Roman to Integer
https://oj.leetcode.com/problems/roman-to-integer/http://fisherlei.blogspot.com/2012/12/leetcode-roman-to-integer.html//Symbol Value //I 1 //V 5 //X 10 //L 50 //C 100 //D 500 //M 1,000 publicclassSolution{ publicintromanToInt(Strings){ Map<Character,In..
分类:其他好文   时间:2015-01-02 16:13:57    阅读次数:163
[LeetCode]15 3Sum
https://oj.leetcode.com/problems/3sum/publicclassSolution{ publicList<List<Integer>>threeSum(int[]num){ //SolutionA //returnthreeSum_Sort(num); //SolutionB returnthreeSum_Map(num); } //////////////////// //SolutionA:Sort // //O(n^2) privateLi..
分类:其他好文   时间:2015-01-02 16:11:46    阅读次数:119
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!