Interview problems solved in Rust

Hey,

I've been learning Rust by solving common interview questions.

The result of my work is here:
https://github.com/brianquinlan/learn-rust

I'm probably going to submit this to Hacker News in the next couple of days so please let me know if you see anything that is unidiomatic or otherwise misguided :slight_smile:

Cheers,
Brian

5 Likes

Posted on Hacker News: https://news.ycombinator.com/item?id=9693561

1st example, alternative (without explicit for ...)

fn main() {
    print!("{}", 
        (1..13).fold(String::new(), |r, i| 
            r + &(1..13).fold(String::new(), |l, j| 
                l + &format!("{:4}", i*j)[..])[..] + "\n"))
}