Skip to content

Conversation

heeh
Copy link
Contributor

@heeh heeh commented Jun 7, 2021

The issue #38 is caused by the code at helper.rs#L126

  1. superscript(n / 10).parse().unwrap_or(0) and superscript(n % 10).parse().unwrap_or(0) always fail.
  2. This happens because parse function does not know the output type. It fails and we get 0 instead of ³¹ as in leetcode pick: wrong constraints #38.
  3. Even if you use parse::<u32>(), parsing a superscript(e.g. ³ ) produces invalid digit error.

I believe that you want to concatenate two superscripts here.
This commit produces a valid representation.

ex) -2³¹ <= num <= 2³¹ - 1

@heeh
Copy link
Contributor Author

heeh commented Jun 7, 2021

This is #37.

You set up the rust toolchain correctly(https://github.com/clearloop/leetcode-cli/blob/master/rust-toolchain#L1)
However, the following workflows invoke rustc 1.54.0-nightly (35fff69d0 2021-06-06) instead of rustc 1.54.0-nightly (8cf990c9b 2021-05-15)

There are two possible fixes.

  1. Make workflow files explicitly use nightly-2021-05-16
  2. Fix cannot find type NoneError in module std::option #37

I committed the first fix.

@clearloop clearloop merged commit a03f7b0 into clearloop:master Jun 8, 2021
@clearloop
Copy link
Owner

Thanks!! @heeh! just published v0.3.7 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants