Arithmetic Sequence in Rust

https://www.codewars.com/kata/52de553ebb55d1fca3000371/train/rust

Try the challenge on CodeWars first – and then have a look at my solution which is mainly based on this challenge.

What did I learn from this?

Well, I worked out that using a HashMap was a neat way to identify the gap that was different to the others.

What else?

Starting from 1 and iterating up to sequence length minus one is the way to stop out of bounds error. (line 29)

Rust Programming

Previous article

Checksum Calculator in Rust
Rust Programming

Next article

flatten v flat_map