Skip to content

python043/coding-problems

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coding Problems

My solutions for many various coding/algorithmic problems (this repo will be updated with new solutions from time to time).
All solutions are written in Python (more precisely, Python 3), using the Built-in Functions and few modules from the Python Standard Library like:

So, to execute these solutions there is no need from installing any external packages.
Coding style and name conventions are described in this file PEP8.
These problems are from sites like LeetCode (you can find more than 30 sites like this in the Training Sites section).
Also in this README you can find many resources for learning algorithms: Courses, Books, Training Sites, Other Resources.

Categories

Each solution/problem in this repo belongs to one of these categories:

  1. Strings
  2. Lists
  3. Linked Lists
  4. Trees
  5. Dynamic Programming
  6. Backtracking
  7. Graphs
  8. Math
  9. Other

Template

Each file with solution in this repo will have the following template:

'''
Problem name

Problem explanation

Input: XXX
Output: XXX
Output explanation: XXX

=========================================
Solution explanation
	Time Complexity: 	O(X)
	Space Complexity: 	O(X)
Solution 2 explanation
(some of the problems are solved in more than one way)
	Time Complexity: 	O(X)
	Space Complexity: 	O(X)
'''

############
# Solution #
############

def name_of_problem(params):
    # description of code
    pass

##############
# Solution 2 #
##############

def name_of_problem_2(params):
    # description of code
    pass


###########
# Testing #
###########

# Test 1
# Correct result => 'result'
print(name_of_problem('example'))

# Test 2
# Correct result => 'result2'
print(name_of_problem_2('example2'))

Courses

Collection of free courses from one of the best CS universities.

  1. Princeton University (Coursera)

  2. Standford University (Coursera)

  3. MIT University (YouTube)

  4. Harvard University (YouTube)

  5. UC Berkeley

Books

Several books that have made an impression on me:

  1. Grokking Algorithms by Aditya Bhargava - The best book for complete beginners in algorithms! I wish this book existed when I started learning algorithms.
  2. Introduction to Algorithms by Thomas H. Cormen
  3. Algorithms by Robert Sedgewick & Kevin Wayne
  4. The Algorithm Design Manual by Steven Skiena

Other

  1. Geeks For Geeks - The site which all interested in algorithms (no matter if beginners or experts) should know!
  2. The Algorithms - Python - Great GitHub repo with many algorithms written in Python.
  3. KhanAcademy - Algorithms - Good explanations for some basic algorithms.
  4. HackerRank - YouTube tutorials

Training

If the problems from LeetCode are not enough and you need more problems like those, you can find much more on these platforms:

About

Solutions for various coding/algorithmic problems and many useful resources for learning algorithms and data structures

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%