/Leetcode-Python

This repo attempts to solve each Leetcode problem listed on seanprashad/leetcode-patterns using Python 3. You can follow the list to solve the core problems on LeetCode and refer to my solving techniques and source code.

Primary LanguagePythonMIT LicenseMIT

Contributors MIT License PR Welcome Author LinkedIn


leetcode python

LeetCode Python

LeetCode in Python 3 with my Explanations.
Report Bug · Request Feature

Table of Contents

About

I use seanprashad / leetcode-patterns as my question list to improve my problem solving skill and algorithm design at LeetCode.

The key features of LeetCode Python:

  • LeetCode questions commonly asked in interviews at large companies
  • Python 3 skills
  • Explanation of logics

Problem List

Easy

Problem Category My Solution Source Code
Contains Duplicate Arrays Link Link
Missing Number Arrays Link Link
Find All Numbers Disappeared in an Array Arrays Link Link
Single Number Arrays | Bit Manipulation Link Link
Climbing Stairs Dynamic Programming Link Link
Best Time to Buy and Sell Stock Dynamic Programming Link Link
Maximum Subarray Dynamic Programming Link Link
Range Sum Query - Immutable Dynamic Programming Link Link
Counting Bits Dynamic Programming | Bit Manipulation Link Link
Linked List Cycle Fast & Slow Pointers Link Link
Middle of the Linked List Fast & Slow Pointers Link Link
Palindrome Linked List Fast & Slow Pointers Link Link
Remove Linked List Elements Fast & Slow Pointers Link Link
Remove Duplicates from Sorted List Fast & Slow Pointers Link Link
Reverse Linked List In-place reversal of a linked list Link Link
Merge Two Sorted Lists Two Pointers Link Link
Binary Search Binary Search Link Link
Find Smallest Letter Greater Than Target Binary Search Link Link
Peak Index in a Mountain Array Binary Search Link Link
Average of Levels in Binary Tree BFS | DFS Link Link
Minimum Depth of Binary Tree BFS | DFS Link Link
Same Tree BFS | DFS Link Link
Path Sum BFS | DFS Link Link
Diameter of Binary Tree DFS Link Link
Merge Two Binary Trees DFS Link Link
Maximum Depth of Binary Tree BFS | DFS Link Link
Lowest Common Ancestor of a Binary Search Tree DFS Link Link
Subtree of Another Tree DFS Link Link
Invert Binary Tree DFS Link Link
Two Sum Two Pointers Link Link
Squares of a Sorted Array Two Pointers Link Link
Majority Element Sorting Link Link

Medium

Problem Category My Solution Source Code
Product of Array Except Self Arrays Link Link
Find the Duplicate Number Arrays | Two Pointers Link Link
Find All Duplicates in an Array Arrays Link Link
Set Matrix Zeroes Arrays Link Link
Spiral Matrix Arrays Link Link
Rotate Image Arrays Link Link
Longest Consecutive Sequence Arrays Link Link
Letter Case Permutation Backtracking Link Link
Subsets Backtracking Link Link
Subsets II Backtracking Link Link
Combination Sum Backtracking Link Link

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Reach out to the maintainer at one of the following places:

Acknowledgements