Git Product home page Git Product logo

algorithm's Introduction

leetcode algorithm which is coded by python


problem 2 使用自己的写的函数addnum会超时,原因未知

problem 3 很重要的题目,要多做几遍, left<=last[s[i]]的这个设置很巧妙,解决了在判断最长字符串中没有更新last而导致left的更新错误的问题,比如'abba'的测试

problem 5 如果用自己的方法时间复杂度是O(n^2),会超时,另一种方法比较漂亮!但是漂亮的解法是马拉车算法

problem 6 方法两种 1是按照顺序存入list的列表中,然后转为string.另一种是寻找字母下标与所在行的数学关系。

problem 7 not solved

problem 8 atoi函数,注意一些细节问题,比如字符串前面是否包含符号,要分别处理

problem 9 回环数,这个题目类比problem5,非常简单。

problem 11 双向指针,查找计算最大值(没有完全理解)

problem 20 自己的方法和提交的方法**一样,本地测试一样,但是OJ上面报错。无奈,拷贝网上的代码。

problem 31 求解下一个组合数(题目很有趣,需要再做一次)

problem 34 二分查找,并且如何使用二分查找,定位到下标最小的target.

problem 50 not solved

problem 53 动态规划,动态方程列出来是关键

problem 54 注意不要重复输出,或者说是注意单行或者单列的情况。对比problem 59

problem 55 Greedy Algorithm.

problem 56 1.排序后,i.start < j.start; 2. 如果j.start < i.end, 则i, j可合并; 3.如果j.start > i.end,则无交集

problem 59 对比problem 54

problem 61 题目很简单,不知为何,注释掉的代码和提交代买一样,但是却不能通过。

problem 73 方法有很多种,最简单的是用两个向量分别记录需要变为0的行和列,最好的方法,是用单个变量记录

problem 74 二位数组的查找,按照顺序排列后,可以使用Binary Search.

problem 75 分别统计0,1,2的个数,然后计算

problem 88 归并排序。

problem 94 下一次学习使用非递归的实现方法

problem 111 DFS的应用。

problem 118 根据杨辉三角的规律直接写即可

problem 119 杨辉三角,有其他简单的解法,我用了最笨的方法,先生成杨辉三角,然后再返回题目要求的那一行。

problem 125 这个题目非常简单,简单处理一下字符串,然后存到list中,比较即可

problem 144 本次使用的是递归方法,下一次尝试使用非递归的写法

problem 151 学会filter的用法,学会join的用法

problem 152 not solved

problem 153 二分查找(binary search)

problem 160 not solved

problem 162 binary search

problem 165 解法很漂亮,学习使用extend,map,split函数,学会使用字符串转为list,dict等处理方法

problem 167 not solved

problem 189

problem 199 not solved

problem 219 not solved

problem 222 not solved

problem 257 DFS 注意python的一些特殊用法。

problem 290 方法二的解答太巧妙,没有学会这个用法。方法的zip也很好

problem 295 not solved

problem 328 not solved

problem 347 下一次尝试使用其他解法,本次解法太依赖python库

problem 405 not solved

problem 409 题目略有技巧性

problem 415 本质是大数加法

algorithm's People

Contributors

dencesun avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.