Skip to content

john-bry/leetcode

Repository files navigation

LeetCode Solutions in Python

A comprehensive collection of LeetCode problems organized by patterns and problem types.

📁 Repository Structure

Core Problem Patterns

  • 01_arrays_and_strings - Array manipulation, string processing
  • 02_two_pointers - Two pointer technique problems
  • 03_sliding_window - Sliding window pattern problems
  • 04_hash_table - Hash table and frequency counting
  • 05_stack_and_queue - Stack and queue data structures
  • 06_linked_list - Linked list operations and algorithms
  • 07_trees - Binary trees, BST, tree traversals
  • 08_graphs - Graph algorithms (DFS, BFS, shortest path)
  • 09_dynamic_programming - DP problems and optimization
  • 10_backtracking - Backtracking and recursive solutions
  • 11_greedy - Greedy algorithm problems
  • 12_binary_search - Binary search variations
  • 13_sorting - Sorting algorithms and problems
  • 14_math - Mathematical problems and number theory
  • 15_bit_manipulation - Bit manipulation techniques
  • 16_union_find - Union-Find data structure problems
  • 17_trie - Trie (prefix tree) problems
  • 18_segment_tree - Segment tree and advanced data structures
  • 19_advanced - Complex algorithms and advanced topics

Utilities

  • utils - Common data structures and helper functions
  • templates - Code templates for different problem types

🚀 Getting Started

  1. Each problem folder contains solutions with:

    • Problem statement
    • Multiple solution approaches
    • Time and space complexity analysis
    • Test cases
  2. Use the templates in the templates/ folder for quick problem setup

  3. Check utils/ for common data structures and helper functions

📊 Problem Difficulty Distribution

  • Easy: Fundamental concepts and basic implementations
  • Medium: Requires understanding of algorithms and data structures
  • Hard: Complex algorithms, optimization, and advanced techniques

🎯 Learning Path

  1. Start with arrays_and_strings for basic concepts
  2. Move to two_pointers and sliding_window for optimization techniques
  3. Practice trees and graphs for recursive thinking
  4. Master dynamic_programming for optimization problems
  5. Explore advanced topics for complex algorithms

📝 Naming Convention

  • Files: problem_number_problem_name.py
  • Example: 0001_two_sum.py
  • Each file includes problem description, solution, and complexity analysis

🔧 Tools and Setup

  • Python 3.8+
  • Recommended IDE: VS Code with Python extension
  • Testing: Use built-in Python unittest or pytest

📚 Resources


Happy coding! 🎉

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published