Interview problems solved in Rust


#1

Hey,

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

The result of my work is here:

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


#2

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


#3

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"))
}