Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions .amazonq/plans/check_problem_lists.py

This file was deleted.

81 changes: 0 additions & 81 deletions .amazonq/plans/export_tags.py

This file was deleted.

61 changes: 61 additions & 0 deletions .cursor/.dev/check_problem_lists.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# TODO: temporary use only while completing ongoing list

import sys
from pathlib import Path

# Import the problem lists
sys.path.append(str(Path(__file__).parent.parent.parent))
from problem_lists import available_lists
from problem_lists.utils import get_existing_problems


def check_problem_list(tag_name, problem_tuples, existing_problems):
"""Check how many problems from a list are available."""
problem_numbers = {num for num, _ in problem_tuples}
have = problem_numbers & existing_problems
missing = problem_numbers - existing_problems

print(f"\n=== {tag_name.upper()} ===")
print(f"Total problems: {len(problem_numbers)}")
print(f"Problems you have: {len(have)} ({len(have)/len(problem_numbers)*100:.1f}%)")
print(f"Problems missing: {len(missing)} ({len(missing)/len(problem_numbers)*100:.1f}%)")

if missing:
print(f"Missing problems: {sorted(missing)}")

return have, missing


def check_problem_lists(tag_names=None):
"""Check problem lists for available problems."""
if tag_names is None:
tag_names = list(available_lists.keys())

existing = get_existing_problems()
print(f"Total existing problems in JSON: {len(existing)}")

results = {}

# Check each specified list
for tag_name, problem_tuples in available_lists.items():
if tag_name in tag_names:
have, missing = check_problem_list(tag_name, problem_tuples, existing)
results[tag_name] = {"have": have, "missing": missing, "total": len(problem_tuples)}

# Summary
print("\n=== SUMMARY ===")
for tag_name, result in results.items():
total = result["total"]
have_count = len(result["have"])
percentage = have_count / total * 100
print(f"{tag_name}: {have_count}/{total} ({percentage:.1f}%)")

return results


def main():
check_problem_lists()


if __name__ == "__main__":
main()
75 changes: 75 additions & 0 deletions .cursor/.dev/next_problem.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# TODO: temporary use only while completing ongoing list

import sys
from pathlib import Path

# Import the problem lists
sys.path.append(str(Path(__file__).parent.parent.parent))
from problem_lists import available_lists
from problem_lists.utils import get_existing_problems


def get_next_problem(tag_names=None):
"""Get the next problem to work on from the list with the lowest missing problems."""
if tag_names is None:
tag_names = list(available_lists.keys())

existing_problems = get_existing_problems()

# Find the list with the lowest missing problems
best_list = None
min_missing = float("inf")
missing_problems = []

for tag_name, problem_tuples in available_lists.items():
if tag_name in tag_names:
problem_numbers = {num for num, _ in problem_tuples}
missing = problem_numbers - existing_problems
missing_count = len(missing)

if missing_count > 0 and missing_count < min_missing:
min_missing = missing_count
best_list = tag_name
missing_problems = sorted(missing)

if not missing_problems:
print("No missing problems found in any of the specified lists!")
return None

# Get the first missing problem from the best list
next_problem_number = missing_problems[0]

# Find the problem name
problem_tuples = available_lists[best_list]
problem_name = None
for num, name in problem_tuples:
if num == next_problem_number:
problem_name = name
break

result = {
"tag_name": best_list,
"problem_number": next_problem_number,
"problem_name": problem_name,
"missing_count": min_missing,
"total_in_list": len(available_lists[best_list]),
}

return result


def main():
next_problem = get_next_problem()
if next_problem:
completed = next_problem["total_in_list"] - next_problem["missing_count"]
total = next_problem["total_in_list"]
percentage = completed / total * 100

print("\n🎯 Next problem to work on:")
print(f" Problem #{next_problem['problem_number']} - {next_problem['problem_name']}")
print(f" Tag: {next_problem['tag_name']}")
print(f" Progress: {completed}/{total} ({percentage:.1f}%)")


if __name__ == "__main__":
main()
7 changes: 7 additions & 0 deletions .cursor/.dev/problem_lists/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from . import algo_master_75, blind_75, neetcode_150

available_lists = {
neetcode_150.tag_name: neetcode_150.problems_list,
algo_master_75.tag_name: algo_master_75.problems_list,
blind_75.tag_name: blind_75.problem_list,
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
algo_master_75_tuples = [
tag_name = "algo-master-75"

problems_list = [
(2, "Add Two Numbers"),
(3, "Longest Substring Without Repeating Characters"),
(4, "Median of Two Sorted Arrays"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
blind_75_tuples = [
tag_name = "blind-75"

problem_list = [
(1, "Two Sum"),
(3, "Longest Substring Without Repeating Characters"),
(5, "Longest Palindromic Substring"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
neetcode_150_tuples = [
tag_name = "neetcode-150"

problems_list = [
(1, "Two Sum"),
(2, "Add Two Numbers"),
(3, "Longest Substring Without Repeating Characters"),
Expand Down
9 changes: 9 additions & 0 deletions .cursor/.dev/problem_lists/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""Shared utilities for problem list management."""

from leetcode_py.cli.utils.problem_finder import _build_problem_number_cache


def get_existing_problems():
"""Get problem numbers from existing JSON files."""
cache = _build_problem_number_cache()
return set(cache.keys())
Loading