Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add feature - generate random problem #9

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

Merged
aylei merged 3 commits into aylei:master from yue2388253:master
Jul 28, 2019
Merged

Conversation

Copy link
Contributor

@yue2388253 yue2388253 commented Jul 4, 2019

use "cargo run random" to generate a random problem.

use "cargo run random" to generate a random problem.
Copy link
Owner

@aylei aylei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM.
And this idea is interesting 😜

src/main.rs Outdated
match id_arg.as_ref() {
"random" => {
println!("You select random mode.");
id = get_random_id();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the problem is locked or don't have a rust version?

Copy link
Contributor Author

@yue2388253 yue2388253 Jul 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, current implementation has such limitation.
Do you think we should verify whether the problem of generated id meet these two requirement at first? And regenerate an id that meets these two requirement

Copy link
Contributor Author

@yue2388253 yue2388253 Jul 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition, using random mode to generate problems results in the disorder of lib.rs

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I think it is nice to have the ID re-generation, but a proper error message is also okay.
  2. It's not a problem, we don't have an order guarantee for lib.rs

Now that using "cargo run" is ok! Then the user could follow the guide of
the system output to do what he/she wants to do (e.g., generate a random
problem or select a particular problem).
Copy link
Contributor Author

Now that the program can handle the case that the problem has no rust version.

However, I don't know what "the problem is locked" means? Could you please say it in more details?

Copy link
Owner

aylei commented Jul 6, 2019

Now that the program can handle the case that the problem has no rust version.

However, I don't know what "the problem is locked" means? Could you please say it in more details?

I mean some problems are only available for leetcode premium, the subscription plan

Copy link
Owner

@aylei aylei left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, is this PR ready to merge? @yue2388253

Copy link
Contributor Author

Sorry to late reply. This PR is ready for merge.

BTW, recently I am preparing my paper and thus might not be able to work on this repo.

Copy link
Owner

aylei commented Jul 28, 2019

@yue2388253 Thanks!

@aylei aylei merged commit f8f1aa7 into aylei:master Jul 28, 2019
Vahor pushed a commit to Vahor/leetcode-rust that referenced this pull request Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@aylei aylei aylei approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /