[New Feature] Now Take Virtual Contest From Terminal
ketankr9 opened this issue · 0 comments
Install
npm install -g https://github.com/ketankr9/leetcode-cli#virtual
Note: This feature is developed on top of leetcode-tools/leetcode-cli 2.6.22
Examples
leetcode virtual weekly-contest-175
✔ [1346] Check If N and Its Double Exist 3 Easy (42.20 %)
[1347] Minimum Number of Steps to Make Two Strings Anagram 4 Medium (76.53 %)
[1348] Tweet Counts Per Frequency 5 Medium (23.66 %)
[1349] Maximum Students Taking Exam 7 Hard (33.83 %)
leetcode virtual weekly-contest-175 --start
[weekly-contest-175] Started Successfully
leetcode virtual weekly-contest-175 --question 0 -gxe
// This works just like ans opens file 1346.check-if-n-and... in editor
leetcode virtual weekly-contest-175 -f 1346.check-if-n-and-its-double-exist.cpp
✔ Finished
✔ Your Input: [10,2,5,3]
✔ Output (8 ms): true
✔ Expected Answer:
✔ Stdout:
leetcode virtual weekly-contest-175 -f 1346.check-if-n-and-its-double-exist.cpp --submit
✔ 104/104 cases passed (4 ms)
✔ Your runtime beats 98.7 % of cpp submissions
✔ Your memory usage beats 100 % of cpp submissions (9.2 MB)
leetcode virtual weekly-contest-175 --myrank
// Note: This isn't final, needs more information and pretty print
{
rank: 1799,
score: 3,
solved: [ { id: 1468, fail_count: 0, solved: 'Accepted' } ]
}
leetcode virtual weekly-contest-175 --end
// In case you want to give-up, just like in leetcode.com
[weekly-contest-175] Ended Successfully
Repo
https://github.com/ketankr9/leetcode-cli/tree/virtual.
TODO
- Remaining time has to be shown somehow and somewhere.
- Ranking is printed as json, also more information is needed.
- Redundancy can be removed if allowed to edit other files.
Known Issues
- github plugin is not working while submitting virtual contest problems.