To aid my coding skill and to succeed in coding interview I am working on a collection of LeetCode problems.
My goal is to help other Python developer who are studying for coding interviews to have a better reference and insight to Leet Code problems, since many of the article/blog on Leet Code problems are written in Java.
- First fork it !
- Add problem and your solution to the appropriate classifier folder
- Submit a pull request to this main repository
- Upon review your contribution will be showing in this repo that will help many others!
I have constructed a blog site to post my thought process on solving some of the problems listed below It can be linked to HERE
-
Array:
- Sorted or not?
- How many elements?
- Element type? Int, float, double?
- What's the range of those numbers? Positive or negative?
- Contain duplicates or not?
- Subsequence: adjacent or not?
-
Binary tree:
- Binary search tree or normal binary tree?
- Balanced or not?
- Complete or not?
- Has parent pointer or not?
-
Linked list:
- Singly or doubly linked list?
- Has duplicated nodal value or not?
-
String:
- Need to remove white spaces? Tab and newline?
- Only has digits? English letters? Upper or lower case?
-
Graph:
- How many nodes and edges?
- Directed or undirected?
- Edges have weights? If so, what's the range?
- Has loops? Negative sum loops?
-
Return value:
- What should my method return?
- If there are multiple solutions to the problem, which one should be returned?
- If it should return multiple values, do you have any preference on what to return?
- What should I do/return if the input is invalid / does not match the constraints?