feat: add 5 more leetcode problems#175
Merged
Merged
Conversation
co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
|
🎉 This PR is included in version 0.47.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
README.md/playground.pyhad drifted from the JSON source of truthChanges
1. Add 5 LeetCode problems
src/leetcode_py/cli/resources/leetcode/json/problems/{palindrome_number,roman_to_integer,longest_common_prefix,three_sum_closest,longest_valid_parentheses}.json+leetcode/<problem>/*Each problem ships a JSON template (source of truth) plus the full generated scaffold —
README.md,solution.py,helpers.py,test_solution.py,playground.py,__init__.py. Solutions implemented optimally:tags.json5registers all five under thegrindtag (alphabetically sorted);bakefile.pyproblemfield set tolongest_valid_parentheses. Each problem has 16 parametrized test cases.2. Sync drifted generated files
leetcode/{alien_dictionary,cheapest_flights_within_k_stops,counting_bits,evaluate_reverse_polish_notation,find_all_anagrams_in_a_string,house_robber,house_robber_ii,is_graph_bipartite,longest_substring_without_repeating_characters,lru_cache,majority_element,merge_triplets_to_form_target_triplet,n_queens,non_overlapping_intervals,number_of_provinces,single_number,single_number_iii,subarray_sum_equals_k,two_sum_ii_input_array_is_sorted,valid_anagram,valid_parenthesis_string,word_search_ii}/Regenerated
README.mdandplayground.pyfor 22 existing problems so they match the JSON templates. Drift was caused by an earlier generator change that stopped escaping*in constraint lines (e.g.3 \* 10^4→3 * 10^4);valid_parenthesis_stringalso picked up a trailing-whitespace fix.solution.pyis excluded from the consistency check and was restored untouched.bake check-consistencynow passes.3. Update dependencies
bakefile[lib]bumped>=0.0.8→>=0.0.57a0(prerelease)pyproject.toml,uv.lock[tool.uv]index-strategy = "unsafe-best-match"/prerelease = "explicit"config and atest-pypisource forbakefileTest plan
bake lintpasses (ruff, ty, deptry, actionlint, sort_tags)bake check-consistencypasses — all generated files match JSON source of truthbake p-test -p <each new problem>— 16/16 tests pass per problem