Skip to content

reorganize by topic - #1

Merged
73anthonyL merged 4 commits into
mainfrom
reorganize-by-topic
Oct 22, 2026
Merged

73anthonyL merged 4 commits into
mainfrom
reorganize-by-topic

Conversation

@73anthonyL

Copy link
Copy Markdown
Owner
  • Move solutions into topic folders
  • Add tests for every solution
  • Run lint and tests in CI
  • Rewrite README for the topic-based layout

73anthonyL and others added 4 commits October 21, 2026 16:07
Group solutions by topic, following the NeetCode roadmap, instead of by
difficulty, and name each file after its problem number and LeetCode URL
slug (e.g. easy/TwoSum.py -> solutions/arrays-and-hashing/0001_two_sum.py).

This commit only renames files, so `git log --follow` keeps each
solution's history. Content changes follow in separate commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add pytest cases for all 32 solutions, using each problem's LeetCode
examples plus a few edge cases (122 cases in total), with one test file
per topic.

Solution files stay exactly as submitted to LeetCode. tests/helpers.py
runs each one with the names LeetCode provides without imports (List,
Optional, deque, ListNode, TreeNode, ...), and finds it by problem
number so tests keep working if a problem moves to another topic. It
also builds linked lists (including cycles) and trees from LeetCode's
input format.

Also add pyproject.toml (pytest and ruff settings, with ruff skipping
solutions/), requirements-dev.txt, and a Python .gitignore.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run `ruff check`, `ruff format --check`, and pytest on pushes to main
and on pull requests, on Python 3.10 (the minimum the solutions'
type-hint syntax supports) and 3.14.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reframe the README around topic-based DSA practice following the NeetCode
roadmap, with a table per topic linking each problem, its solution, and
its time and space complexity. The old table had already drifted: Assign
Cookies (#455) was missing.

tests/test_repository.py now fails CI if a solution is missing from the
README, a README row's link doesn't match its file name, or a solution
has no test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@73anthonyL
73anthonyL merged commit 316c0a6 into main Oct 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant