Here you can find solutions for various coding/algorithmic problems and many useful resources for learning algorithms and data structures. Also, this repo will be updated with new solutions and resources from time to time.
Algorithms and data structures are not language-specific (it's true that some languages are faster, and some are easier to use), but if you are good with the logic and pseudocode, any language would be good. So I've decided to use Python because I think it's very close to pseudocode and it's easily readable (so it'll be easy for someone from another environment to implement the same solutions). As I said previously, all solutions are written in Python (more precisely, Python 3), using the Built-in Functions (print, len, range, sorted, sum, min, max, etc...) and a few modules from the Python
'''
Problem Name
Problem explanation.
Input: XXX
Output: XXX
Output explanation: XXX
=========================================
Solution 1 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 1 #
##############
def name_of_solution_1(params):
# description of code
pass
##############
# Solution 2 #
##############
def name_of_solution_2(params):
# description of code
pass
###########
# Testing #
###########
# Test 1
# Correct result => 'result1'
test_val = 'example1'
print(name_of_solution_1(test_val))
print(name_of_solution_2(test_val))
# Test 2
# Correct result => 'result2'
test_val = 'example2'
print(name_of_solution_1(test_val))
print(name_of_solution_2(test_val))