• 大小: 0.72M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-03-26
  • 语言: Java
  • 标签: java  

资源简介


leetcode(含python、java、c)代码合集,目录清晰,适合刷leetcode的朋友参考

资源截图

代码片段和文件信息

public class Solution {
    public List> threeSum(int[] num) {
        
        Arrays.sort(num);
        
        List> found = new ArrayList<>();
        
        int pneg = 0  ppos = num.length - 1;
        
        while(ppos > 0 && num[ppos] >= 0){
            
            while(pneg < ppos && num[pneg] <= 0){
                
                int sum = num[pneg] + num[ppos];

                for(int i  = pneg + 1; i < ppos; i++){
                    if(num[i] + sum == 0){
                        found.add(Arrays.asList(new Integer[]{num[pneg] num[i] num[ppos]}));
                        
                        break;
                    }
                }
                
                int old = num[pneg];
                while(pneg < ppos && num[pneg] == old) pneg++;                
            }
            
            pneg = 0;
            
            int old = num[ppos];
            while(ppos > 0 && num[ppos] == old) ppos--;
        }
    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    .......       209  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\.gitignore

    .......       118  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\3sum\index.md

    .......       811  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\3sum\README.md

    .......      1035  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\3sum\Solution.java

    .......       126  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\3sum-closest\index.md

    .......        73  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\3sum-closest\README.md

    .......      1002  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\3sum-closest\Solution.java

    .......       118  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\4sum\index.md

    .......       413  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\4sum\README.md

    .......      2477  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\4sum\Solution.java

    .......       158  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\add-and-search-word-data-structure-design\index.md

    .......         0  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\add-and-search-word-data-structure-design\README.md

    .......      2087  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\add-and-search-word-data-structure-design\Solution.java

     文件         13  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\add-and-search-word-data-structure-design\WordDictionary.java

    .......       124  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\add-binary\index.md

    .......       112  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\add-binary\README.md

    .......      1150  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\add-binary\Solution.java

    .......       125  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\add-digits\index.md

    .......         0  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\add-digits\README.md

    .......       113  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\add-digits\Solution.java

    .......       128  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\add-two-numbers\index.md

    .......       140  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\add-two-numbers\README.md

    .......      1246  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\add-two-numbers\Solution.java

    .......       122  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\anagrams\index.md

    .......       312  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\anagrams\README.md

    .......       575  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\anagrams\Solution.java

     文件        326  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\auto_time.sh

    .......       135  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\balanced-binary-tree\index.md

    .......       139  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\balanced-binary-tree\README.md

    .......       744  2015-09-24 03:03  leetcode\leetcode(java)\leetcode-gh-pages\balanced-binary-tree\Solution.java

............此处省略2086个文件信息

评论

共有 条评论