pub fn factorial(num: u64) -> u64 {
    // Complete this function to return the factorial of num
    // Do not use:
    // - return
    // Try not to use:
    // - imperative style loops (for, while)
    // - additional variables
    // For an extra challenge, don't use:
    // - recursion
    // Execute `rustlings hint iterators4` for hints.
    return (1..=num).product()
}
/* Hint: Read about what methods iterator offers. https://doc.rust-lang.org/std/iter/trait.Iterator.html */
Read about what methods iterator offers.
Read about what methods iterator offers .
pub fn factorial(num: u64) -> u64 {
    // Complete this function to return the factorial of num
    // Do not use:
    // - return
    // Try not to use:
    // - imperative style loops (for, while)
    // - additional variables
    // For an extra challenge, don't use:
    // - recursion
    // Execute `rustlings hint iterators4` for hints.
    return (1..=num).product()
}
pub fn factorial ( num : u64 ) -> u64 { // Complete this function to return the factorial of num // Do not use: // - return // Try not to use: // - imperative style loops (for, while) // - additional variables // For an extra challenge, don't use: // - recursion // Execute `rustlings hint iterators4` for hints. return ( 1 ..= num ) . product ( ) }
Hint: Read about what methods iterator offers.
Hint : Read about what methods iterator offers .
num
u64
num
u64