码迷,mamicode.com
首页 >  
搜索关键字:problems    ( 6275个结果
[LeetCode]11 Container With Most Water
https://oj.leetcode.com/problems/container-with-most-water/http://fisherlei.blogspot.com/2013/01/leetcode-container-with-most-water.htmlpublicclassSolution{ publicintmaxArea(int[]height){ //SolutionB: //returnmaxArea_BruteForce(height); //SolutionA: retur..
分类:其他好文   时间:2015-01-02 16:15:22    阅读次数:158
[LeetCode]16 3Sum Closest
https://oj.leetcode.com/problems/3sum-closest/http://fisherlei.blogspot.com/2013/01/leetcode-3sum-closest-solution.htmlpublicclassSolution{ publicintthreeSumClosest(int[]num,inttarget){ //Inputvalidations //... Arrays.sort(num); intlen=num.length; intmin..
分类:其他好文   时间:2015-01-02 16:14:25    阅读次数:116
[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]14 Longest Common Prefix
https://oj.leetcode.com/problems/longest-common-prefix/http://fisherlei.blogspot.com/2012/12/leetcode-longest-common-prefix.htmlpublicclassSolution{ publicStringlongestCommonPrefix(String[]strs) { //Validations if(strs==null||strs.length==0) return""; if(s..
分类:其他好文   时间:2015-01-02 16:13:25    阅读次数:103
[LeetCode]17 Letter Combinations of a Phone Number
https://oj.leetcode.com/problems/letter-combinations-of-a-phone-number/http://fisherlei.blogspot.com/2012/12/leetcode-letter-combinations-of-phone.htmlpublicclassSolution{ publicList<String>letterCombinations(Stringdigits){ if(digits==null) returnnul..
分类:其他好文   时间:2015-01-02 16:13:14    阅读次数:134
[LeetCode]19 Remove Nth Node From End of List
https://oj.leetcode.com/problems/remove-nth-node-from-end-of-list/http://fisherlei.blogspot.com/2012/12/leetcode-remove-nth-node-from-end-of.html/** *Definitionforsingly-linkedlist. *publicclassListNode{ *intval; *ListNodenext; *ListNode(intx){ *val=x; *nex..
分类:其他好文   时间:2015-01-02 16:12:53    阅读次数:132
[LeetCode]22 Generate Parentheses
https://oj.leetcode.com/problems/generate-parentheses/http://fisherlei.blogspot.com/2012/12/leetcode-generate-parentheses.htmlpublicclassSolution{ publicList<String>generateParenthesis(intn){ //SolutionB: //returngenerateParenthesis_BruteForce(n); ..
分类:其他好文   时间:2015-01-02 16:12:32    阅读次数:137
[LeetCode]20 Valid Parentheses
https://oj.leetcode.com/problems/valid-parentheses/http://fisherlei.blogspot.com/2013/01/leetcode-valid-parentheses.htmlpublicclassSolution{ publicbooleanisValid(Strings) { if(s==null) returntrue; Stack<Character>stack=newStack<>(); for(charc:s..
分类:其他好文   时间:2015-01-02 16:12:14    阅读次数:99
[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
迷上了代码!