Skip to content

Commit 5c8188b

Browse files
mathusanm6Copilot
andauthored
feat: add auto-generated problems list (#67)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 57e7760 commit 5c8188b

File tree

8 files changed

+408
-83
lines changed

8 files changed

+408
-83
lines changed

Makefile

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,27 @@ stats:
265265
# Update README badges with current problem counts
266266
.PHONY: update-badges
267267
update-badges:
268-
@echo "$(call color_green,Updating README badges...)"
268+
@echo "Updating README badges..."
269269
@./scripts/update_badges.sh
270+
@echo "$(call color_green,README badges updated.)"
271+
272+
# README Generation
273+
.PHONY: readme
274+
readme: ## Generate README from problem configurations
275+
@$(PYTHON) scripts/generate_readme.py
276+
277+
.PHONY: readme-check
278+
readme-check: ## Check if README is up to date
279+
@echo "Checking if README is up to date..."
280+
@cp README.md README.md.backup
281+
@$(PYTHON) scripts/generate_readme.py > /dev/null
282+
@if ! diff -q README.md README.md.backup > /dev/null; then \
283+
echo "$(call color_yellow,README is out of date. Run 'make readme' to update.)"; \
284+
mv README.md.backup README.md; \
285+
else \
286+
echo "$(call color_green,README is up to date.)"; \
287+
rm README.md.backup; \
288+
fi
270289

271290
# Debug Google Test configuration
272291
.PHONY: debug-gtest
@@ -334,6 +353,8 @@ help:
334353
@echo "$(call color_yellow,Utility Targets:)"
335354
@echo " clean - Clean build artifacts"
336355
@echo " stats - Show project statistics"
356+
@echo " readme - Generate README from problem configurations"
357+
@echo " readme-check - Check if README is up to date"
337358
@echo " update-badges - Update README badges with current problem counts"
338359
@echo " debug-gtest - Debug Google Test configuration"
339360
@echo " help - Show this help message"

README.md

Lines changed: 15 additions & 82 deletions
Large diffs are not rendered by default.

config/difficulties.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
difficulties:
2+
- easy
3+
- medium
4+
- hard

config/tags.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
tags:
2+
- "Arrays & Hashing"
3+
- "Two Pointers"
4+
- "Sliding Window"
5+
- "Stack"
6+
- "Matrix"
7+
- "Intervals"
8+
- "Linked List"
9+
- "Binary Tree General"
10+
- "Binary Tree BFS"
11+
- "Binary Search Tree"
12+
- "Graph General"
13+
- "Dynamic Programming"
14+
- "Backtracking"
15+
- "Heap"
16+
- "Greedy"
17+
- "Trie"

problems/two_sum/config.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
problem:
2+
number: 1
3+
title: "Two Sum"
4+
leetcode_url: "https://leetcode.com/problems/two-sum/"
5+
difficulty: "easy"
6+
tags: ["Arrays & Hashing"]
7+
8+
solutions:
9+
python: "problems/two_sum/two_sum.py"
10+
cpp: "problems/two_sum/two_sum.cc"
11+
12+
complexity:
13+
time: "O(n)"
14+
space: "O(n)"
15+
16+
notes: ""
17+
readme_link: ""
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
problem:
2+
number: 125
3+
title: "Valid Palindrome"
4+
leetcode_url: "https://leetcode.com/problems/valid-palindrome/"
5+
difficulty: "easy"
6+
tags: ["Two Pointers"]
7+
8+
solutions:
9+
python: "problems/valid_palindrome/valid_palindrome.py"
10+
cpp: "problems/valid_palindrome/valid_palindrome.cc"
11+
12+
complexity:
13+
time: "O(n)"
14+
space: "O(1)"
15+
16+
notes: ""
17+
readme_link: ""

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ ruff
77
# Testing tools
88
pytest
99
pytest-cov
10+
11+
# YAML processing library
12+
PyYAML

0 commit comments

Comments
 (0)