Giter Club home page Giter Club logo

leetup's Introduction

If you use neovim, try this Neovim plugin leetup.nvim

crates Downloads CI

Solve Leetcode problems

Install

  • MacOS:
brew install leetup
  • Linux:
    Download from releases. Extract the zipped file and set the PATH.
  • Cargo:
cargo install leetup
  • Windows:
    Download from releases. Extract the zipped x86_64 windows target file.

Note: You will need to add leetup.exe to PATH to access from Command Prompt.

Quick Start:

  • Login using Cookie: leetup user -c

    • You need to login on leetcode.com first.
    • Copy csrftoken and LEETCODE_SESSION from cookie storage in the browser.
  • Pick a problem: leetup pick -l python 1

  • Test a problem: leetup test two-sum.py -t "[1,2]\n3" or redirect test data using stdin

    leetup test 3sum.java -t << END
    [1,-1,0]
    [0, 1, 1, 1, 2, -3, -1]
    [1,2,3]
    END
    
  • Submit a problem: leetup submit two-sum.py

  • List/Show problems: leetup list

    • Search by keyword: leetup list <keyword>
    • Query easy: leetup list -q e
    • Order by Id, Title, Difficulty: leetup list -qE -oIdT
  • More Commands

Inject code fragments:

You can inject pieces of code that you frequently use in certain positions of the generated code file. Example: Standard library imports for each language can be put into a config. Leetup will pick it up and insert into the generated file.

Config:

Create ~/.leetup/config.json and customize according to your preference:

{
    "lang": "java",
    "inject_code": {
        "rust": {
            "before_code": ["use std::rc::Rc;", "use std::collections::{HashMap, VecDeque};", "use std::cell::RefCell;"],
            "before_code_exclude": ["// Test comment", "// Test code"],
            "after_code": "\nstruct Solution; \n\nfn main() {\n    let solution = Solution::$func();\n\n}\n",
            "before_function_definition": null
        },
        "java": {
            "before_code": "import java.util.*;",
            "before_code_exclude": ["// Test comment", "// Test code"],
            "after_code": null,
            "before_function_definition": null
        },
        "python3": {
            "before_code": "import math",
            "before_code_exclude": ["# Test comment", "# Test code"],
            "after_code": ["if __name__ = \"__main__\":", "    solution = Solution()"],
            "before_function_definition": null
        }
    }
}

Generated code looks something like this in Rust:

// @leetup=custom
// @leetup=info id=1 lang=rust slug=two-sum

/*
* [SNIP]
*/
// @leetup=custom

// @leetup=inject:before_code_ex
// Test comment
// Test code
// @leetup=inject:before_code_ex

// @leetup=code

// @leetup=inject:before_code
use std::cell::RefCell;
use std::collections::{HashMap, VecDeque};
use std::rc::Rc;
// @leetup=inject:before_code

impl Solution {
    pub fn two_sum(nums: Vec<i32>, target: i32) -> Vec<i32> {}
}
// @leetup=code

// @leetup=inject:after_code
// This is helpful when you want to run this program locally
// and avoid writing this boilerplate code for each problem.
struct Solution;

fn main() {
    let solution = Solution::two_sum();
}

// @leetup=inject:after_code

During testing and submitting to Leetcode, only the chunk of code between @leetup=code will be submitted:

// @leetup=inject:before_code
use std::cell::RefCell;
use std::collections::{HashMap, VecDeque};
use std::rc::Rc;
// @leetup=inject:before_code

impl Solution {
    pub fn two_sum(nums: Vec<i32>, target: i32) -> Vec<i32> {
    }
}

Others are ignored!

Hook up script for Pick:

Run scripts before/after code generation. It's useful when you want more ergonomics to move around the generated file e.g. create a directory, move the generated file to the directory, rename, etc. @leetup=working_dir will be replaced by working_dir in config.
@leetup=problem will be replaced by the current problem tile e.g. two-sum.

{
    "lang": "rust",
    "inject_code": {
        ...SNIP...
    },
    "pick_hook": {
        "rust": {
            "working_dir": "~/lc/rust",
            "script": {
                "pre_generation": ["cd @leetup=working_dir; mkdir -p @leetup=problem"],
                "post_generation": ["mv @leetup=working_dir/@leetup=problem.rs @leetup=working_dir/@leetup=problem/Solution.rs"]
            }
        },
        "java": {
            "working_dir": "~/lc/java",
            "script": {
                "pre_generation": ["cd @leetup=working_dir", "mvn archetype:generate -DartifactId=@leetup=problem  -DgroupId=leetup  -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false"], 
                "post_generation": ["mv @leetup=working_dir/@leetup=problem.java @leetup=working_dir/@leetup=problem/src/main/java/App.java"]
            }
        }
    }
}

Credit:

This project is inspired by: https://github.com/leetcode-tools/leetcode-cli

leetup's People

Contributors

dependabot[bot] avatar devhindo avatar dieterplex avatar dragfire avatar jkurian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

leetup's Issues

Panic when piping to head

rustc --version
rustc 1.68.0-nightly (ad8ae0504 2022-12-29)

leetup --version
leetup 1.0.2

Installed from cargo

Executing the following command results in a panic.

RUST_BACKTRACE=full leetup list | head
       [ 1  ] Two Sum                                                                     Easy
       [ 2  ] Add Two Numbers                                                             Medium
       [ 3  ] Longest Substring Without Repeating Characters                              Medium
       [ 4  ] Median of Two Sorted Arrays                                                 Hard
       [ 5  ] Longest Palindromic Substring                                               Medium
       [ 6  ] Zigzag Conversion                                                           Medium
       [ 7  ] Reverse Integer                                                             Medium
       [ 8  ] String to Integer (atoi)                                                    Medium
       [ 9  ] Palindrome Number                                                           Easy
       [ 10 ] Regular Expression Matching                                                 Hard
thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', library/std/src/io/stdio.rs:1008:9
stack backtrace:
   0:     0x5591a656204a - std::backtrace_rs::backtrace::libunwind::trace::h2c91251742244ab1
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x5591a656204a - std::backtrace_rs::backtrace::trace_unsynchronized::h6d44d12bbe0e7aa5
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x5591a656204a - std::sys_common::backtrace::_print_fmt::ha87b8dc49e99d364
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x5591a656204a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7f18c6c63225ad77
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x5591a6587d1e - core::fmt::write::h123cb6ce9edafa10
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/core/src/fmt/mod.rs:1208:17
   5:     0x5591a655c725 - std::io::Write::write_fmt::h3baf40d36b1d4cae
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/io/mod.rs:1682:15
   6:     0x5591a6561e15 - std::sys_common::backtrace::_print::h742af007f102c03d
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x5591a6561e15 - std::sys_common::backtrace::print::hc384317cb61775ee
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x5591a65635ff - std::panicking::default_hook::{{closure}}::heaed0ea0b0024643
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/panicking.rs:267:22
   9:     0x5591a656333b - std::panicking::default_hook::h55ca1d41de87c814
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/panicking.rs:286:9
  10:     0x5591a6563d0c - std::panicking::rust_panic_with_hook::hc503d371d7184fb8
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/panicking.rs:688:13
  11:     0x5591a6563aa9 - std::panicking::begin_panic_handler::{{closure}}::he73b2aadf63f621d
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/panicking.rs:579:13
  12:     0x5591a65624fc - std::sys_common::backtrace::__rust_end_short_backtrace::h35aea8344e0a609e
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x5591a65637b2 - rust_begin_unwind
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/panicking.rs:575:5
  14:     0x5591a6055cc3 - core::panicking::panic_fmt::h6793a7ba783923fd
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/core/src/panicking.rs:64:14
  15:     0x5591a655bcb7 - std::io::stdio::print_to::h6d170d348ae8b241
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/io/stdio.rs:1008:9
  16:     0x5591a655bcb7 - std::io::stdio::_print::h25c3291cd76d82e5
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/io/stdio.rs:1074:5
  17:     0x5591a60b06dd - leetup::service::provider::ServiceProvider::pretty_list::h95f6cc86362f596e
  18:     0x5591a60a8f7f - <leetup::service::leetcode::Leetcode as leetup::service::provider::ServiceProvider>::list_problems::{{closure}}::h47637bbc9037b8da
  19:     0x5591a605c843 - tokio::runtime::park::CachedParkThread::block_on::h60a012512e85f1b9
  20:     0x5591a6060cce - tokio::runtime::scheduler::multi_thread::MultiThread::block_on::h3f2200c369c7da7e
  21:     0x5591a6064531 - leetup::main::h1cccc2385728c6ec
  22:     0x5591a605d8c6 - std::sys_common::backtrace::__rust_begin_short_backtrace::hdea56dfaefbcd45e
  23:     0x5591a6062f05 - std::rt::lang_start::{{closure}}::h5ab3601104337ff0
  24:     0x5591a655569c - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h58d45763274069d8
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/core/src/ops/function.rs:287:13
  25:     0x5591a655569c - std::panicking::try::do_call::hfcfea82d5cb40d1b
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/panicking.rs:483:40
  26:     0x5591a655569c - std::panicking::try::h7a85b63463a445ae
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/panicking.rs:447:19
  27:     0x5591a655569c - std::panic::catch_unwind::h7e7df17272140cb2
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/panic.rs:140:14
  28:     0x5591a655569c - std::rt::lang_start_internal::{{closure}}::h9c4d5573b14f2e51
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/rt.rs:148:48
  29:     0x5591a655569c - std::panicking::try::do_call::h10168884f4613e63
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/panicking.rs:483:40
  30:     0x5591a655569c - std::panicking::try::h63a5c88ff6bb4f98
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/panicking.rs:447:19
  31:     0x5591a655569c - std::panic::catch_unwind::hf0d849019b9f3364
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/panic.rs:140:14
  32:     0x5591a655569c - std::rt::lang_start_internal::haecacab0475edaf4
                               at /rustc/ad8ae0504c54bc2bd8306abfcfe8546c1bb16a49/library/std/src/rt.rs:148:20
  33:     0x5591a60646e5 - main
  34:     0x7fbfede29d90 - <unknown>
  35:     0x7fbfede29e40 - __libc_start_main
  36:     0x5591a6056335 - _start
  37:                0x0 - <unknown>

Maybe remove the error tags?

It looks like the project has two abnormal tags as shown below, maybe those two can be removed? (asking because it caused some livecheck issue on the homebrew project), thanks!

image

Feature: crash with an error message

When I try to submit/test a problem, it just outputs "Runtime Error" and does nothing.

leetup submit search-in-rotated-sorted-array.rb
#=> ⢹ Waiting for judge result!Runtime Error

Could you provide logging for errors? so that I can understand what I did wrong

Create a Vim plugin

Do everything inside Vim/Neovim: Navigation, Exploring problems, Solve, Test, Submit.

leetup test encounters an error

~# leetup test longest-common-prefix.py -t '["1"]'

⣸ Waiting for judge result!thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/service/leetcode.rs:653:64            
stack backtrace:                                                                                                                              
⣇ Waiting for judge result!   0:     0x557469683e50 - std::backtrace_rs::backtrace::libunwind::trace::h63b7a90188ab5fb3                       
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/../../backtrace/src/backtrace/libunwind.rs:9
0:5                                                                    
   1:     0x557469683e50 - std::backtrace_rs::backtrace::trace_unsynchronized::h80aefbf9b851eca7      
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x557469683e50 - std::sys_common::backtrace::_print_fmt::hbef05ae4237a4d72                                             
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x557469683e50 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h28abce2fdb9884c2
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x5574696a6bff - core::fmt::write::h3b84512577ca38a8   
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/fmt/mod.rs:1092:17
   5:     0x55746967d8b2 - std::io::Write::write_fmt::h465f8feea02e2aa1 
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/io/mod.rs:1572:15
   6:     0x557469685fc5 - std::sys_common::backtrace::_print::h525280ee0d29bdde
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x557469685fc5 - std::sys_common::backtrace::print::h1f0f5b9f3ef8fb78
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x557469685fc5 - std::panicking::default_hook::{{closure}}::ha5838f6faa4a5a8f
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:208:50
   9:     0x557469685a73 - std::panicking::default_hook::hfb9fe98acb0dcb3b
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:225:9
  10:     0x5574696865cd - std::panicking::rust_panic_with_hook::hb89f5f19036e6af8
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:591:17
  11:     0x557469686137 - std::panicking::begin_panic_handler::{{closure}}::h119e7951427f41da
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:495:13
  12:     0x55746968430c - std::sys_common::backtrace::__rust_end_short_backtrace::hce386c44bf47a128
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/sys_common/backtrace.rs:141:18
  13:     0x5574696860c9 - rust_begin_unwind
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:493:5
  14:     0x55746915f471 - core::panicking::panic_fmt::h2242888e8769cd33
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/panicking.rs:92:14
  15:     0x55746915f3bd - core::panicking::panic::h10ab123a4b13cc79
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/panicking.rs:50:5
  16:     0x557469192098 - <leetup::service::leetcode::Leetcode as leetup::service::provider::ServiceProvider>::problem_test::h9240a17f70ab901
5
  17:     0x55746917ef7f - leetup::cmd::process::h314518d541f20451
  18:     0x55746915fee6 - leetup::main::ha430b6c68499d4fc
  19:     0x55746915ffb3 - std::sys_common::backtrace::__rust_begin_short_backtrace::hf47a4d505712b6df
  20:     0x55746915ff89 - std::rt::lang_start::{{closure}}::h1aa4320a6abffc5e
  21:     0x557469686aca - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h44574effd2120c86
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/ops/function.rs:259:13
  22:     0x557469686aca - std::panicking::try::do_call::h10b0bd4879c8dfb0
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:379:40
  23:     0x557469686aca - std::panicking::try::h60c6780d33419e92
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:343:19
  24:     0x557469686aca - std::panic::catch_unwind::h111f33e08c52e2ce
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panic.rs:431:14
  25:     0x557469686aca - std::rt::lang_start_internal::h126f2e09345dbfda
                               at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/rt.rs:51:25
  26:     0x55746915ff72 - main
⡧ Waiting for judge result!  27:     0x7fcdca0271e2 - __libc_start_main 
  28:     0x55746915fb59 - _start
  29:                0x0 - <unknown>

leetup test failure

👋 while upgrading rust to 1.77.0, I noticed that leetup test is failing (also see the test failure in the latest 1.2.5 release build as well)

$ /opt/homebrew/Cellar/leetup/1.2.4/bin/leetup list
Error: Reqwest(reqwest::Error { kind: Decode, source: Error("expected value", line: 1, column: 1) })

Did leetcode change the behavior requiring login to show the problem list? (the error msg is not user friendly)

bug: leetup test stop working in windows

In windows 11, when i run :
leetup test two-sum.cpp -t "[1,2]\n3"

The error is :

thread '' panicked at 'called Result::unwrap() on an Err value: NotSupported', C:\Users\liran.cargo\registry\src\mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd\spinner-0.5.0\src\lib.rs:164:37
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Status: 403 Forbidden

Note: If error status is 4XX, make sure you are logged in!

I made sure I am logged in, but this error is still.

❯ rustc --version
rustc 1.72.0 (5680fa18f 2023-08-23)
❯ leetup --version
leetup 1.2.4

thanks!

bug: leetup pick stop working at/after 2618

"leetup pick 2617" still work

but "leetup pick 2618" prompted

thread 'main' panicked at 'called Option::unwrap() on a None value', C:\Users\k.cargo\registry\src\github.com-1ecc6299db9ec823\leetup-1.0.2\src\service\leetcode.rs:602:51
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

thanks

Add tests for all commands

Test:

    list      List questions
    pick      Pick a problem
    submit    Submit a problem
    test      Submit a problem
    user      User auth

When try to login github, it gives error.

⢺ Logging in...thread 'main' panicked at 'called Option::unwrap() on a None value', src/service/auth.rs:137:54
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

I got this. error. When I try to login. with "leetup user -g"

Cache all topic tags

Have all topic-tags cached.
Topics: [array, dynamic-programming, string, math, tree, depth-first-search, hash-table, greedy, binary-search, breadth-first-search, sort, two-pointers, stack, backtracking, design, bit-manipulation, graph, linked-list, heap, union-find, sliding-window, divide-and-conquer, trie, recursion, segment-tree, ordered-map, geometry, queue, minimax, brainteaser, binary-indexed-tree, line-sweep, random, topological-sort, binary-search-tree, rolling-hash, rejection-sampling, reservoir-sampling, memoization, suffix-array]

Sample GraphQL request:

{
  "operationName": "getTopicTag",
  "variables": {
    "slug": "array"
  },
  "query": "query getTopicTag($slug: String!) {\n  topicTag(slug: $slug) {\n    name\n    translatedName\n    slug\n    questions {\n      status\n      questionId\n      questionFrontendId\n      title\n      titleSlug\n      translatedTitle\n      stats\n      difficulty\n      isPaidOnly\n      topicTags {\n        name\n        translatedName\n        slug\n        __typename\n      }\n      companyTags {\n        name\n        translatedName\n        slug\n        __typename\n      }\n      __typename\n    }\n    frequencies\n    __typename\n  }\n  favoritesLists {\n    publicFavorites {\n      ...favoriteFields\n      __typename\n    }\n    privateFavorites {\n      ...favoriteFields\n      __typename\n    }\n    __typename\n  }\n}\n\nfragment favoriteFields on FavoriteNode {\n  idHash\n  id\n  name\n  isPublicFavorite\n  viewCount\n  creator\n  isWatched\n  questions {\n    questionId\n    title\n    titleSlug\n    __typename\n  }\n  __typename\n}\n"
}

Relevant code: https://github.com/dragfire/leetup/blob/master/src/service/leetcode.rs#L414-L437

[BUG] Leetup submits to the wrong problem

When I submit a 1903 largest-odd-number-in-string solution, the submission for 1756 design-most-recently-used-queue appears in my recent submissions.
obraz

But here are the first two lines of my solution (largest-odd-number-in-string.java):

// @leetup=custom
// @leetup=info id=1903 lang=java slug=largest-odd-number-in-string

Of course it fails with compilation error that some method was not found.

The issue occurs with more problems, but I haven't discovered the pattern yet.

Feature request: pick daily challenge

Would you add some command to solve daily challenges? I won't need to visit the leetcode.com

PS. I like your job very much! It's much faster than using laggy web.

support cargo run

would be nice to be able to use cargo run on the generated files, that is, optionally use cargo init to create a project and make the generated file the main.rs of that project

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.