Skip to content

fix and simplify rust solution for 0036-valid-sudoku #2474

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
merged 1 commit into from
Aug 4, 2023

Conversation

Adimac93
Copy link
Contributor

Previous incorrect submission: https://leetcode.com/problems/valid-sudoku/submissions/949595521/

  1. fix for bx indices
  2. use of returned insertion status

Note
https://doc.rust-lang.org/std/collections/struct.HashSet.html#method.insert
If the set did not previously contain this value, true is returned.
If the set already contained this value, false is returned.

@oliverocean
Copy link

@Adimac93 thanks so much for posting this... I was banging on the current "solution" for several days, trying to figure out what was wrong... was about to give up and then found your PR that makes it work correctly! :)

@oliverocean
Copy link

@neetcode-gh please merge this in if possible (and put on neetcode.io)! The current Rust solution has a small but critical error, the PR here by @Adimac93 fixes the solution and also makes it more idiomatic. Thanks!

@tahsintunan tahsintunan merged commit 4dc4303 into neetcode-gh:main Aug 4, 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

Successfully merging this pull request may close these issues.

3 participants