Coder Social home page Coder Social logo

leetcode-python's Introduction

Automation

add2Readme.py can:

  1. Add folder for each question, and generate Python file, readme.md file and .gitignore file with the new folder
  2. Add links to readme.md

The using method is: python add2Readme.py --name "Container With Most Water" -i 11 -d medium -t array

update_ideas.py can search for comments of each python file and add that to basic ideas, which requires the comment musk be a short introduction of the answer.

Leetcode Solutions for Python

This repository focuses on solving all Leetcode problems with Python. The layout has two factors, which are tags and difficulty. Besides, there will be explanation for each question.

Array

Easy

# Title Explanation Code Basic Ideas
1 Two Sum Answer Python 1. Hash Table
2. One-Pass Hash Table
26 Remove Duplicates from Sorted Array Answer Python 1. Two Pointers
27 Remove Element Answer Python 1. Two Pointers
35 Search Insert Position Answer Python 1. Binary Search
2. Improvement on avoiding checking "middle" on mismatch
3. Less code but slower
53 Maximum Subarray Answer Python 1. Dynamic Programming
2. Less code version of DP
66 Plus One Answer Python 1. Test equal to 9
88 Merge Sorted Array Answer Python 1. Two Pointer
2. Optimisation for TP
118 Pascals Triangle Answer Python

Medium

# Title Explanation Code Basic Ideas
11 Container With Most Water Answer Python

Hard

# Title Explanation Code Basic Ideas
4 Median of Two Sorted Arrays Answer Python

leetcode-python's People

Contributors

wanghongkua 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.