diff --git a/solution/1800-1899/1823.Find the Winner of the Circular Game/README_EN.md b/solution/1800-1899/1823.Find the Winner of the Circular Game/README_EN.md index ae70a45fec097..fa56b8fe1bcf3 100644 --- a/solution/1800-1899/1823.Find the Winner of the Circular Game/README_EN.md +++ b/solution/1800-1899/1823.Find the Winner of the Circular Game/README_EN.md @@ -165,6 +165,20 @@ var findTheWinner = function (n, k) { }; ``` +#### Rust + +```rust +impl Solution { + pub fn find_the_winner(n: i32, k: i32) -> i32 { + if n == 1 { + return 1; + } + let mut ans = (k + Solution::find_the_winner(n - 1, k)) % n; + return if ans == 0 { n } else { ans }; + } +} +``` +