Skip to content

Conversation

@jessedoka
Copy link

Hey, just wanted to add this feature, which is basically able to filter the problem list using both text and JSON files.

For example:

list.json

# My LeetCode Study List
two-sum
4sum|arrays,hash-table
longest-palindromic-substring|dynamic-programming

list.txt

{
  "dynamic-programming": [
    "longest-palindromic-substring",
    "coin-change"
  ],
  "arrays": [
    "two-sum",
    "4sum"
  ]
}

Basic Use:

:Leet custom file=my_list.txt

With additional Filters

:Leet custom file=my_list.txt filter=difficulty difficulty=medium
:Leet custom file=my_list.txt filter=status status=notac

Proof that is works.
Screencast from 2024-11-20 22-10-27.webm

(copilot summary below)

New functionality for custom list filtering:

  • lua/leetcode/cache/problemlist.lua: Added parse_custom_list function to parse custom list files and filter_by_custom_list function to filter problems based on the custom list. Also added Problemlist.filter_by_file method to integrate these functions.

Command structure updates:

@jessedoka jessedoka changed the title Filtering Problem List using local files. Feat: Filtering Problem List using local files. Nov 20, 2024
@jessedoka
Copy link
Author

Here is neetcode 150 if you want to test it yourself.
neetcode.txt

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