This section of the Algorithmic-Thinking repo contains my solutions to LeetCode challenges solved using Python3 that have the algorithms tag.
Each solution is my final after multiple iterations to get a more streamlined and resource efficient code.
I will try to remember to edit each to explain the steps for later looking back.
- Python3 solutions to LeetCode problems.
- One liners for each if possible.
- Clean, commented code with problem context in each file header.
- A focus on writing clean, readable Python.
Each file follows a consistent header format:
# Source : <leetcode problem url>
# Author : Rose Martin
# Date : YYYYMMDD
########################################
Description right from Leetcode
########################################
Commented solution code
I believe in:
- Writing code that is readable, not just functional
- Understanding the algorithm before reaching for the shortcut
- Understanding why a one-liner works, not just that it works
- Testing multiple approaches to know which tool fits best
| # | Title | Difficulty | Final Solution | One Liner |
|---|---|---|---|---|
| 1 | Two Sum | Easy | TwoSum.py | - |
| 2 | Add Two Numbers | Medium | AddTwoNumbers.py | - |
| 3 | Longest Substring Without Repeating Characters | Medium | LongestSubstring.py | - |
| 4 | Median of Two Sorted Arrays | Hard | MedianTwoArrays.py | - |
| 5 | Longest Palindromic Substring | Medium | LongestPalindrome.py | - |
| 6 | Zigzag Conversion | Medium | ZigzagConversion.py | - |
| 7 | Reverse Integer | Medium | ReverseInteger.py | - |
| 8 | String to Integer (atoi) | Medium | Atoi.py | - |
| 9 | Palindrome Number | Easy | PalindromeNumber.py | - |
| 10 | Regular Expression Matching | Hard | RegexMatching.py | - |
Built and maintained by Ebony Rose Martin https://thatone.dev