Skip to content

leetcode list -p plan1 filtering not working #79

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

Closed
eleijonmarck opened this issue Jul 11, 2022 · 5 comments
Closed

leetcode list -p plan1 filtering not working #79

eleijonmarck opened this issue Jul 11, 2022 · 5 comments

Comments

@eleijonmarck
Copy link

eleijonmarck commented Jul 11, 2022

Hey, followed the example from

# ~/.leetcode/scripts/plan1.py
import json;

def plan(sps, stags):
    ##
    # `print` in python is supported, 
    # if you want to know the data structures of these two args, 
    # just print them
    ##
    problems = json.loads(sps)
    tags = json.loads(stags)
	
    ret = []
    tm = {}
    for tag in tags:
        tm[tag["tag"]] = tag["refs"];

    for i in problems:
        if i["level"] == 1 and str(i["id"]) in tm["linked-list"]:
            ret.append(str(i["id"]))

    # return is `List[string]`
    return ret
$ ls ~/.leetcode/scripts
blind75.py plan1.py
leetcode list -p plan1

...
  🔒    [2282] Number of People That Can Be Seen in a Grid                  Medium (50.67 %)
  🔒    [2291] Maximum Profit From Trading Stocks                           Medium (48.73 %)
  🔒    [2292] Products With Three or More Orders in Two Consecutive Years  Medium (36.96 %)
  🔒    [2298] Tasks Count in the Weekend                                   Medium (87.84 %)
  🔒    [2308] Arrange Table by Gender                                      Medium (78.74 %)
  🔒    [2314] The First Day of the Maximum Recorded Degree in Each City    Medium (79.27 %)
  🔒    [2324] Product Sales Analysis IV                                    Medium (87.50 %)
  🔒    [2329] Product Sales Analysis V                                     Medium (82.71 %)
  🔒    [2323] Find Minimum Time to Finish All Jobs II                      Medium (78.78 %)
  🔒    [2330] Valid Palindrome IV                                          Medium (78.99 %)
 ...

Still getting all of the problems

@clearloop
Copy link
Owner

clearloop commented Jul 11, 2022

pym = ["pyo3"]

Hey @eleijonmarck , try reinstall leetcode-cli with cargo install leetcode-cli --features pym !

@eleijonmarck
Copy link
Author

eleijonmarck commented Jul 12, 2022

thats okay, i just do not want to download the nightly or dev builds.

$ cargo install leetcode-cli --features pym

...
error: failed to run custom build command for `pyo3 v0.8.5`

Caused by:
  process didn't exit successfully: `/var/folders/tf/md89rf0x6l10l39lmd7r3rn00000gn/T/cargo-installeyxep6/release/build/pyo3-0019e4bb55db8eca/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'Error: pyo3 requires a nightly or dev version of Rust.', /Users/eleijonmarck/.cargo/registry/src/git.freesoso.sbs-1ecc6299db9ec823/pyo3-0.8.5/build.rs:542:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `leetcode-cli v0.3.11`, intermediate artifacts can be found at `/var/folders/tf/md89rf0x6l10l39lmd7r3rn00000gn/T/cargo-installeyxep6`

@clearloop
Copy link
Owner

sry

cargo +nightly install leetcode-cli --features pym

this feature requires nightly toolchain

@eleijonmarck
Copy link
Author

1 % cargo +nightly install leetcode-cli --features pym

error: toolchain 'nightly-aarch64-apple-darwin' is not installed
(base)

on m1 unfortunately so it does not work :(

even following:
https://www.reddit.com/r/rust/comments/lleh8v/having_trouble_compiling_on_apple_m1/

Current installation options:


   default host triple: nightly-aarch64-apple-darwin
     default toolchain: stable
               profile: default
  modify PATH variable: yes

@clearloop
Copy link
Owner

I'll try to upgrade the deps of that feature and see if pyo3 have stable feature releases

dubeyKartikay added a commit to dubeyKartikay/leetcode-cli that referenced this issue Sep 11, 2023
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

No branches or pull requests

2 participants