Data Structures and Algorithms 🌏
This repository contains the code solutions (with complete well written notes) of DSA problems from LeetCode.
- Complete Code-Explanations
- Multiple Approaches (Brute-force to Optimal)
- Clean Codes (PEP 8 ✅)
- Readability (Good Naming Convention)
- Complexity Analysis
"""
Question URL (`LC or GFG or CN`)
"""
def function(arg: type) -> type:
""""""
# 0) Brute-force (Technique Used): TC = O(n); SC = O(n)
# (Optional) Approach
# (Optional) Any Helpful Link
"""
PEP 8 Code with Explanatory Comments
"""
# 1) Better/Sub-Optimal (Technique Used): TC = O(n); SC = O(n)
# (Optional) Approach
# (Optional) Any Helpful Link
"""
PEP 8 Code with Explanatory Comments
"""
# 2) Optimal (Technique Used): TC = O(n); SC = O(n)
# (Optional) Approach
# (Optional) Any Helpful Link
ans = arg # any comment if required
return ans # any comment if required
“Indeed, the ratio of time spent reading versus writing is well over 10 to 1. We are constantly reading old code as part of the effort to write new code. ...[Therefore,] making it easy to read makes it easier to write.”
― Robert C. Martin, Clean Code: A Handbook of Agile Software Craftsmanship