my leetcode solutions in rust

Overview

My Leetcode Solution in Rust

Run cargo run {id} to initialize the template submission file of "question #id".

Run cargo test test_{id} to test the solution for "question #id".

对于大部分难度为 Hard 的问题, 会有中文的思路注释

Working in progress, to do:

  • auto generation of solution list (when 100 problems solved)

Usage

  • Remove all the solution .rs
  • Clean lib.rs file
  • Start your leetcode journey in rust by typing cargo run {question_id}
Comments
  • Fixed the problem of generating wrong id

    Fixed the problem of generating wrong id

    [description] when i typed 1000, I got n1030_minimum_cost_to_merge_stones.rs [fixed] Incorrect use tag "problem.stat.frontend_question_id" vs "problem.stat.question_id"

    opened by Qanora 9
  • 62 does not seem right to me

    62 does not seem right to me

    The formula you gave seems incorrect to me. I know you said it's high school math, but I guess I forgot it.

    It works, for the example, but I don't see how it could work for many other ones.

    For example, say you have a 3x3 matrix. With your formula, it would be 3!/(3!*(3 - 3)!) = 1. It seems to me like there would be more than one way to make it down in a 3 by 3 matrix. In fact, matrix with the same number of rows and columns would equal 1 with the formula n! / r!(n-r)!.

    Am I missing something here?

    opened by zwhitchcox 4
  • Fix the inconsistency

    Fix the inconsistency

    There is some inconsistency between src/lib.rs and new problem-solving files, which is fixed in this PR.

    All *.rs files are processed by rustfmt as well.

    opened by mapx 1
  • '...' range patterns are deprecated, fix it

    '...' range patterns are deprecated, fix it

    Compile the previous program results in serveral following warnings:

    warning: ... range patterns are deprecated --> src/n0008_string_to_integer_atoi.rs:77:24 | 77 | '0'...'9' => { | ^^^ help: use ..= for an inclusive range | = note: #[warn(ellipsis_inclusive_range_patterns)] on by default

    See this link for more details

    opened by yue2388253 1
  • Change End value as the code fails the test case where the array contains one value

    Change End value as the code fails the test case where the array contains one value

    The input:

    • The array: [2]
    • the value: 3
    • the output: [ ] (testcase failed)
    • The expected output: [2] (as the array only contains one value "2" which is different from "3")
    opened by ByteSudoer 0
  • Bump thread_local from 1.0.1 to 1.1.4

    Bump thread_local from 1.0.1 to 1.1.4

    Bumps thread_local from 1.0.1 to 1.1.4.

    Commits
    • 4a54e57 Bump version to 1.1.4
    • ebf8b45 Merge pull request #34 from ibraheemdev/patch-1
    • 3d69afa Fix memory ordering in RawIter::next
    • c7d8dcd Bump version to 1.1.3
    • 5e8bbf2 Merge pull request #30 from Marwes/fix_drop
    • a44b836 fix: Drop the value in the ThreadLocal on drop
    • 322cf34 Bump version to 1.1.2
    • dca4007 Merge pull request #29 from Kestrer/raw-iter
    • 33ad405 Add #[inline] to non-generic functions
    • 810c043 Implement iterator logic in RawIter
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump futures-task from 0.3.4 to 0.3.21

    Bump futures-task from 0.3.4 to 0.3.21

    Bumps futures-task from 0.3.4 to 0.3.21.

    Release notes

    Sourced from futures-task's releases.

    0.3.21

    • Fix potential data race in FlattenUnordered that introduced in 0.3.20 (#2566)

    0.3.20

    • Fix stacked borrows violations when -Zmiri-tag-raw-pointers is enabled. This raises MSRV of futures-task to 1.45. (#2548, #2550)
    • Change FuturesUnordered to respect yielding from future (#2551)
    • Add StreamExt::{flatten_unordered, flat_map_unordered} (#2083)

    0.3.19

    • Remove unstable read-initializer feature (#2534)
    • Fix panic in FuturesUnordered (#2535)
    • Fix compatibility issue with FuturesUnordered and tokio's cooperative scheduling (#2527)
    • Add StreamExt::count (#2495)

    0.3.18

    • Fix unusable Sink implementation on stream::Scan (#2499)
    • Make task::noop_waker_ref available without std feature (#2505)
    • Add async LineWriter (#2477)
    • Remove dependency on proc-macro-hack. This raises MSRV of utility crates to 1.45. (#2520)

    0.3.17

    • Use FuturesOrdered in join_all (#2412)
    • Add {future, stream}::poll_immediate (#2452)
    • Add stream_select! macro (#2262)
    • Implement Default for OptionFuture (#2471)
    • Add Peekable::{peek_mut, poll_peek_mut} (#2488)
    • Add BufReader::seek_relative (#2489)

    0.3.16

    • Add TryStreamExt::try_chunks (#2438)
    • Add StreamExt::{all, any} (#2460)
    • Add stream::select_with_strategy (#2450)
    • Update to new io_slice_advance interface (#2454)

    0.3.15

    • Use #[proc_macro] at Rust 1.45+ to fix an issue where proc macros don't work with rust-analyzer (#2407)
    • Support targets that do not have atomic CAS on stable Rust (#2400)
    • futures-test: Add async #[test] function attribute (#2409)
    • Add stream::abortable (#2410)
    • Add FuturesUnordered::clear (#2415)
    • Implement IntoIterator for FuturesUnordered (#2423)
    • Implement Send and Sync for FuturesUnordered iterators (#2416)
    • Make FuturesUnordered::iter_pin_ref public (#2423)
    • Add SelectAll::clear (#2430)
    • Add SelectAll::{iter, iter_mut} (#2428)
    • Implement IntoIterator for SelectAll (#2428)
    • Implement Clone for WeakShared (#2396)

    0.3.14

    • Add future::SelectAll::into_inner (#2363)

    ... (truncated)

    Changelog

    Sourced from futures-task's changelog.

    0.3.21 - 2022-02-06

    • Fix potential data race in FlattenUnordered that introduced in 0.3.20 (#2566)

    0.3.20 - 2022-02-06

    NOTE: This release has been yanked due to a bug fixed in 0.3.21.

    • Fix stacked borrows violations when -Zmiri-tag-raw-pointers is enabled. This raises MSRV of futures-task to 1.45. (#2548, #2550)
    • Change FuturesUnordered to respect yielding from future (#2551)
    • Add StreamExt::{flatten_unordered, flat_map_unordered} (#2083)

    0.3.19 - 2021-12-18

    • Remove unstable read-initializer feature (#2534)
    • Fix panic in FuturesUnordered (#2535)
    • Fix compatibility issue with FuturesUnordered and tokio's cooperative scheduling (#2527)
    • Add StreamExt::count (#2495)

    0.3.18 - 2021-11-23

    NOTE: This release has been yanked. See #2529 for details.

    • Fix unusable Sink implementation on stream::Scan (#2499)
    • Make task::noop_waker_ref available without std feature (#2505)
    • Add async LineWriter (#2477)
    • Remove dependency on proc-macro-hack. This raises MSRV of utility crates to 1.45. (#2520)

    0.3.17 - 2021-08-30

    • Use FuturesOrdered in join_all (#2412)
    • Add {future, stream}::poll_immediate (#2452)
    • Add stream_select! macro (#2262)
    • Implement Default for OptionFuture (#2471)
    • Add Peekable::{peek_mut, poll_peek_mut} (#2488)
    • Add BufReader::seek_relative (#2489)

    0.3.16 - 2021-07-23

    • Add TryStreamExt::try_chunks (#2438)
    • Add StreamExt::{all, any} (#2460)
    • Add stream::select_with_strategy (#2450)
    • Update to new io_slice_advance interface (#2454)

    0.3.15 - 2021-05-11

    • Use #[proc_macro] at Rust 1.45+ to fix an issue where proc macros don't work with rust-analyzer (#2407)
    • Support targets that do not have atomic CAS on stable Rust (#2400)
    • futures-test: Add async #[test] function attribute (#2409)
    • Add stream::abortable (#2410)

    ... (truncated)

    Commits
    • fc1e325 Release 0.3.21
    • 20279eb FlattenUnordered: improve wakers behavior (#2566)
    • 75dca5a Fix MSRV in futures-task readme
    • 55281c8 Release 0.3.20
    • 591b982 Redefine executor and compat modules in futures crate (#2564)
    • 94b508b Basic StreamExt::{flatten_unordered, flat_map_unordered} impls (#2083)
    • dca16fa Do not auto-create PR on fork
    • a9795a9 Automatically creates PR when no_atomic_cas.rs needs to be updated
    • 4841888 Update comments in build scripts
    • 85706b6 Clean up ci/no_atomic_cas.sh
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump futures-util from 0.3.4 to 0.3.21

    Bump futures-util from 0.3.4 to 0.3.21

    Bumps futures-util from 0.3.4 to 0.3.21.

    Release notes

    Sourced from futures-util's releases.

    0.3.21

    • Fix potential data race in FlattenUnordered that introduced in 0.3.20 (#2566)

    0.3.20

    • Fix stacked borrows violations when -Zmiri-tag-raw-pointers is enabled. This raises MSRV of futures-task to 1.45. (#2548, #2550)
    • Change FuturesUnordered to respect yielding from future (#2551)
    • Add StreamExt::{flatten_unordered, flat_map_unordered} (#2083)

    0.3.19

    • Remove unstable read-initializer feature (#2534)
    • Fix panic in FuturesUnordered (#2535)
    • Fix compatibility issue with FuturesUnordered and tokio's cooperative scheduling (#2527)
    • Add StreamExt::count (#2495)

    0.3.18

    • Fix unusable Sink implementation on stream::Scan (#2499)
    • Make task::noop_waker_ref available without std feature (#2505)
    • Add async LineWriter (#2477)
    • Remove dependency on proc-macro-hack. This raises MSRV of utility crates to 1.45. (#2520)

    0.3.17

    • Use FuturesOrdered in join_all (#2412)
    • Add {future, stream}::poll_immediate (#2452)
    • Add stream_select! macro (#2262)
    • Implement Default for OptionFuture (#2471)
    • Add Peekable::{peek_mut, poll_peek_mut} (#2488)
    • Add BufReader::seek_relative (#2489)

    0.3.16

    • Add TryStreamExt::try_chunks (#2438)
    • Add StreamExt::{all, any} (#2460)
    • Add stream::select_with_strategy (#2450)
    • Update to new io_slice_advance interface (#2454)

    0.3.15

    • Use #[proc_macro] at Rust 1.45+ to fix an issue where proc macros don't work with rust-analyzer (#2407)
    • Support targets that do not have atomic CAS on stable Rust (#2400)
    • futures-test: Add async #[test] function attribute (#2409)
    • Add stream::abortable (#2410)
    • Add FuturesUnordered::clear (#2415)
    • Implement IntoIterator for FuturesUnordered (#2423)
    • Implement Send and Sync for FuturesUnordered iterators (#2416)
    • Make FuturesUnordered::iter_pin_ref public (#2423)
    • Add SelectAll::clear (#2430)
    • Add SelectAll::{iter, iter_mut} (#2428)
    • Implement IntoIterator for SelectAll (#2428)
    • Implement Clone for WeakShared (#2396)

    0.3.14

    • Add future::SelectAll::into_inner (#2363)

    ... (truncated)

    Changelog

    Sourced from futures-util's changelog.

    0.3.21 - 2022-02-06

    • Fix potential data race in FlattenUnordered that introduced in 0.3.20 (#2566)

    0.3.20 - 2022-02-06

    NOTE: This release has been yanked due to a bug fixed in 0.3.21.

    • Fix stacked borrows violations when -Zmiri-tag-raw-pointers is enabled. This raises MSRV of futures-task to 1.45. (#2548, #2550)
    • Change FuturesUnordered to respect yielding from future (#2551)
    • Add StreamExt::{flatten_unordered, flat_map_unordered} (#2083)

    0.3.19 - 2021-12-18

    • Remove unstable read-initializer feature (#2534)
    • Fix panic in FuturesUnordered (#2535)
    • Fix compatibility issue with FuturesUnordered and tokio's cooperative scheduling (#2527)
    • Add StreamExt::count (#2495)

    0.3.18 - 2021-11-23

    NOTE: This release has been yanked. See #2529 for details.

    • Fix unusable Sink implementation on stream::Scan (#2499)
    • Make task::noop_waker_ref available without std feature (#2505)
    • Add async LineWriter (#2477)
    • Remove dependency on proc-macro-hack. This raises MSRV of utility crates to 1.45. (#2520)

    0.3.17 - 2021-08-30

    • Use FuturesOrdered in join_all (#2412)
    • Add {future, stream}::poll_immediate (#2452)
    • Add stream_select! macro (#2262)
    • Implement Default for OptionFuture (#2471)
    • Add Peekable::{peek_mut, poll_peek_mut} (#2488)
    • Add BufReader::seek_relative (#2489)

    0.3.16 - 2021-07-23

    • Add TryStreamExt::try_chunks (#2438)
    • Add StreamExt::{all, any} (#2460)
    • Add stream::select_with_strategy (#2450)
    • Update to new io_slice_advance interface (#2454)

    0.3.15 - 2021-05-11

    • Use #[proc_macro] at Rust 1.45+ to fix an issue where proc macros don't work with rust-analyzer (#2407)
    • Support targets that do not have atomic CAS on stable Rust (#2400)
    • futures-test: Add async #[test] function attribute (#2409)
    • Add stream::abortable (#2410)

    ... (truncated)

    Commits
    • fc1e325 Release 0.3.21
    • 20279eb FlattenUnordered: improve wakers behavior (#2566)
    • 75dca5a Fix MSRV in futures-task readme
    • 55281c8 Release 0.3.20
    • 591b982 Redefine executor and compat modules in futures crate (#2564)
    • 94b508b Basic StreamExt::{flatten_unordered, flat_map_unordered} impls (#2083)
    • dca16fa Do not auto-create PR on fork
    • a9795a9 Automatically creates PR when no_atomic_cas.rs needs to be updated
    • 4841888 Update comments in build scripts
    • 85706b6 Clean up ci/no_atomic_cas.sh
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump net2 from 0.2.33 to 0.2.37

    Bump net2 from 0.2.33 to 0.2.37

    Bumps net2 from 0.2.33 to 0.2.37.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump miow from 0.2.1 to 0.2.2

    Bump miow from 0.2.1 to 0.2.2

    Bumps miow from 0.2.1 to 0.2.2.

    Commits
    • 6fd7b9c Bump version to 0.2.2
    • 550efc2 Merge branch 'fix-sockaddr-convertion-v0.2.x' into 0.2.x
    • ca8db53 Stop using from_ne_bytes to be compatible with Rust < 1.32.0
    • 3e217e3 Bump net2 dep to 0.2.36 without invalid SocketAddr convertion
    • 27b77cc Adapt to winapi 0.2
    • 2783715 Safely convert SocketAddr into raw SOCKADDR
    • f6662ef Clarify wording of license information in README.
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump hyper from 0.12.35 to 0.12.36

    Bump hyper from 0.12.35 to 0.12.36

    Bumps hyper from 0.12.35 to 0.12.36.

    Changelog

    Sourced from hyper's changelog.

    v0.12.36 (2021-02-17)

    Bug Fixes

    • client: allow client GET requests with explicit body headers (23fc8b08, closes #1925)
    • dependencies: use correct minimum versions (#1974) (90c1e8f4)
    • http1: fix server misinterpretting multiple Transfer-Encoding headers (f6051250)
    • server: allow Server::local_addr to be called with custom executor (#2009) (da16ed62)

    Features

    • client:
      • add resolve timeout to HttpConnector (#1994) (d4ee6996)
      • Add connect timeout to HttpConnector (3d676fb7)
    Commits
    • 4c82565 v0.12.36
    • 6d9003d chore(lib): fix new unused variable lint
    • f605125 fix(http1): fix server misinterpretting multiple Transfer-Encoding headers
    • a115c30 chore(lib): allow deprecations in 0.12.x builds
    • d4ee699 feat(client): add resolve timeout to HttpConnector (#1994)
    • da16ed6 fix(server): allow Server::local_addr to be called with custom executor (#2...
    • 3d676fb feat(client): Add connect timeout to HttpConnector
    • 90c1e8f fix(dependencies): use correct minimum versions (#1974)
    • 4d188d1 chore(ci): update MSRV to 1.31 (parking_lot uses 2018 edition)
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Manipulating rust iterators

    Manipulating rust iterators

    Hi,

    Out of interest, I read one of your solution s0007.

    I was given the impression from problem desc that a solution would be like

    str.push('-');
    str[1..].chars().rev().collect::<String>().parse().unwrap_or(0)
    

    Your code is much like c than rust.

    opened by maicallist 0
  • filter useless snippets when add a problem and rustfmt code

    filter useless snippets when add a problem and rustfmt code

    filter useless tag like this:

    * Input: 
     * 
     * 1 0 1 0 0
     * 1 0 <font color="red">1 <font color="red">1 1
     * 1 1 <font color="red">1 <font color="red">1 1
     * 1 0 0 1 0
     * 
     * Output: 4
     * 
     */
    
    opened by whalecold 2
  • Separate LC problem manipulation to a standalone Cargo extension

    Separate LC problem manipulation to a standalone Cargo extension

    Currently, the problem manipulation tool is mixed with solutions, which is inflexible and cannot be easily used outside this project.

    Build a standalone Cargo extension to do such stuffs will be more maintainable and usable.

    opened by aylei 0
  • leetcode的id和slug不匹配

    leetcode的id和slug不匹配

    我改了下代码输出接口获取的problem,发现id和slug并不匹配:

    cargo run 179
       Compiling leetcode-rust v0.1.0 (/Users/daniel/CLionProjects/leetcode-rust)
        Finished dev [unoptimized + debuginfo] target(s) in 3.86s
         Running `target/debug/leetcode-rust 179`
    id: 1057, code: rust, slug: numbers-with-repeated-digits
    id: 1056, code: rust, slug: capacity-to-ship-packages-within-d-days
    id: 1055, code: rust, slug: pairs-of-songs-with-total-durations-divisible-by-60
    id: 1054, code: rust, slug: complement-of-base-10-integer
    id: 1050, code: rust, slug: construct-binary-search-tree-from-preorder-traversal
    id: 1049, code: rust, slug: minimum-domino-rotations-for-equal-row
    id: 1048, code: rust, slug: clumsy-factorial
    id: 1047, code: rust, slug: maximize-sum-of-array-after-k-negations
    id: 1046, code: rust, slug: max-consecutive-ones-iii
    id: 1045, code: rust, slug: check-if-word-is-valid-after-substitutions
    
    
    opened by tinycedar 0
Owner
Aylei
Software Engineer @pingcap, ZJUer. Previously @exacloud
Aylei
The solutions for Leetcode's problem

Leetcode The solutions for Leetcode's problem # Ttitle Solution Diffculty 1 Two Sum Rust, TypeScript Easy 5 Longest Palindromic Substring Rust, TypeSc

Eleven 2 Jul 21, 2022
Use Rust to solve questions on Leetcode.

Rust for Leetcode 本仓库用于记录我使用Rust刷Leetcode的代码,尽量做到日更。 题目列表 编号 名称 题目类型 题解 678 有效的括号字符串 栈 valid-parenthesis-string.rs 461 汉明距离 位运算 hamming-distance.rs 62

Rui Li 1 Mar 3, 2022
A full-featured Leetcode API on Rust language

LeetCode API Rust Library This Rust library provides a convenient way to interact with the LeetCode API, allowing you to programmatically access LeetC

null 2 Jul 13, 2023
Coding-challenge - Algorithms and Data-structures, problems and solutions in Rust language using cargo-workspaces

Coding Challenge LeetCode/Hackerrank e.t.c Using this as an opportunity to improve my knowledge of rust lang If you found this repo useful to you, add

Tolumide Shopein 17 Apr 24, 2022
Fastest solutions for various Rust algorithms from challenges

Algs These are the results of going through various challenges and solutions to find the fastest and most concise algorithms. It is structured by data

Jack Clayton 1 Jan 20, 2022
Rust-algorithm-club - Learn algorithms and data structures with Rust

Rust Algorithm Club ?? ?? This repo is under construction. Most materials are written in Chinese. Check it out here if you are able to read Chinese. W

Weihang Lo 360 Dec 28, 2022
Ternary search tree collection in rust

tst Ternary search tree collection in rust with similar API to std::collections as it possible. Ternary search tree is a type of trie (sometimes calle

Alexey Pervushin 20 Dec 7, 2022
Array helpers for Rust's Vector and String types

array_tool Array helpers for Rust. Some of the most common methods you would use on Arrays made available on Vectors. Polymorphic implementations for

Daniel P. Clark 69 Dec 9, 2022
Generic array types in Rust

generic-array This crate implements generic array types for Rust. Requires minumum Rust version of 1.36.0, or 1.41.0 for From<[T; N]> implementations

Bartłomiej Kamiński 325 Dec 25, 2022
A priority queue for Rust with efficient change function.

PriorityQueue This crate implements a Priority Queue with a function to change the priority of an object. Priority and items are stored in an IndexMap

null 139 Dec 30, 2022
K-dimensional tree in Rust for fast geospatial indexing and lookup

kdtree K-dimensional tree in Rust for fast geospatial indexing and nearest neighbors lookup Crate Documentation Usage Benchmark License Usage Add kdtr

Rui Hu 152 Jan 2, 2023
Roaring bitmap implementation for Rust

RoaringBitmap This is not yet production ready. The API should be mostly complete now. This is a Rust port of the Roaring bitmap data structure, initi

Roaring bitmaps: A better compressed bitset 552 Jan 1, 2023
Rust Persistent Data Structures

Rust Persistent Data Structures Rust Persistent Data Structures provides fully persistent data structures with structural sharing. Setup To use rpds a

Diogo Sousa 883 Dec 31, 2022
Rust crate to extend io::Read & io::Write types with progress callbacks

progress-streams Rust crate to provide progress callbacks for types which implement io::Read or io::Write. Examples Reader extern crate progress_strea

Pop!_OS 19 Dec 3, 2022
Parameterized routing for generic resources in Rust

Usher Usher provides an easy way to construct parameterized routing trees in Rust. The nodes of these trees is naturally generic, allowing Usher to le

Isaac Whitfield 34 Oct 22, 2022
RiteLinked - LinkedHashMap & LinkedHashSet in Rust

RiteLinked -- HashMap-like containers that hold their key-value pairs in a user controllable order RiteLinked provides more up to date versions of Lin

Rite Database 52 Aug 19, 2022
A proof of concept implementation of cyclic data structures in stable, safe, Rust.

A proof of concept implementation of cyclic data structures in stable, safe, Rust. This demonstrates the combined power of the static-rc crate and the

null 157 Dec 28, 2022
Doubly-Linked List Implementation in Rust

Doubly-Linked List Implementation in Rust Purely for educational and recreational purposes. For real world production please use std::collections::Lin

Tsoding 9 Jul 28, 2022
Rust library for string parsing of basic data structures.

afmt Simple rust library for parsing basic data structures from strings. Usage You can specify string formats to any strucute, via the use of the fmt

Eduard 4 May 8, 2021