Git Product home page Git Product logo

leetcode's Introduction

leetcode

刷题总结

  • 数组题,辅助HashMap/Set能解大多问题;转换为字符串有时也是巧妙的思路(比如数独有效性的判断); 边界处理逻辑应该在正常流程中,以保持代码精简(而不是单独写很多独立的逻辑,如果是则说明代码不够优雅,越多代码越容易出错)
    • 边界位置应小心处理(至少有case覆盖到),很多WA问题就出在这里,如题26。
    • 搭配多个指针,也能有奇效,尤其能避免超时的问题,如题121.
  • 树题,递归是常用套路,关键也在递归式的设计
  • 链表题,搭配多个指针,能有奇效
  • 排序题,除了常规排序算法的前向遍历;后向遍历有时能出其不意(如题88)
  • 字符串题,和数值型进行转换时,务必考虑到溢出的情况(如题7)

回溯(Backtracking)

Weekly TODO

  • week(08-28): 总结回溯算法,同时梳理做过的相关题目。做 216题.

leetcode's People

Contributors

kufei-dxm 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.