-
Notifications
You must be signed in to change notification settings - Fork 13
feat: leetcode script #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
add category selection and problem extraction from tags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new feature for LeetCode scripting that adds category selection and problem extraction from tags. Key changes include adding new functions (extract_problems and input_pick_array) in spider.py and leetcode.py, updating the user prompt for problem selection, and extending the get problem options to include a "Category" via option 5.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
python/scripts/spider.py | Added new functions for holiday and problem extraction; updated the main entry. |
python/scripts/leetcode.py | Extended the problem selection prompt with a new "Category" option and added input_pick_array. |
Comments suppressed due to low confidence (2)
python/scripts/leetcode.py:76
- [nitpick] The prompt string in the 'input_pick_array' function is slightly ambiguous regarding the '0' option versus the 'random' default. Consider rephrasing it (for example, by separating the 'Back' option from the random selection instruction) to enhance clarity.
f"Enter the number of the {desc} [1-{len(arr)}, or 0 to go back or random [default: 0]: "
python/scripts/leetcode.py:223
- [nitpick] The error message here could be more explicit. Consider rewording it to 'Failed to fetch the problem. Please verify that the problem ID {problem_id} is correct.' for improved user guidance.
print(f"Failed to fetch the problem. Check {problem_id} is correct?")
add argparse for command line interface in spider script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces additional problem extraction functionality and expands the LeetCode script to support category selection.
- Added new functions in spider.py to extract problems from HTML content and support a dedicated subcommand.
- Updated leetcode.py to include a new “Category” option in the problem retrieval prompt with supporting helper function for dynamic input selection.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
python/scripts/spider.py | Added BeautifulSoup-based HTML problem extraction and a new subparser. |
python/scripts/leetcode.py | Updated get problem options to include category selection and added input_pick_array. |
enhance problem extraction with error handling and argument parsing
add category selection and problem extraction from tags