20240731 Finished

This commit is contained in:
jackfiled 2024-07-31 10:54:14 +08:00
parent bd6382ab87
commit dc662fe156
2 changed files with 34 additions and 1 deletions

View File

@ -190,3 +190,4 @@ mod p136_single_number;
mod p137_single_number_ii; mod p137_single_number_ii;
mod p201_bitwise_and_of_numbers_range; mod p201_bitwise_and_of_numbers_range;
mod p66_plus_one; mod p66_plus_one;
mod p172_factorial_trailing_zeroes;

View File

@ -0,0 +1,32 @@
/**
* [172] Factorial Trailing Zeroes
*/
pub struct Solution {}
// submission codes start here
impl Solution {
pub fn trailing_zeroes(n: i32) -> i32 {
let mut n = n;
let mut result = 0;
while n > 0 {
n /= 5;
result += n;
}
result
}
}
// submission codes end
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_172() {
}
}