You don't have flatten, but you can easily replace it with flat_map:
let a = [vec![1, 3, 5], vec![7, 9]];
// let flat = a.iter().flatten().collect::<Vec<_>>();
let flat = a.iter().flat_map(|x| x).collect::<Vec<_>>();
println!("{:?}", flat);
I solved it by doing reductions, also let the solution to the problem as it is explained. I would suggest to just change the description and go on with this with another Kata, both are great but not mixed ;)
This was a bit hard to understand at somepoint (more because of my fault than the exercise itself), but really amazing to solve. Would be great if we can solve the next
version in Rust.
magic numbers in calculate function???
I'd give you the most bonus points for keeping to the theme and role play!
Same! =D
I had a very similar solution, but I like that yours goes further by adding the Battle::Result enum with Display.
Maybe take it a step further and impl PartialOrd for GoodSide and EvilSide?
wtf dude
Looks very very interesting!
You don't have flatten, but you can easily replace it with flat_map:
@Chrono79 I just did read the answers but thinking on a spiral staircase is one of the dumbest things I've heard on 2018 :D
I solved it by doing reductions, also let the solution to the problem as it is explained. I would suggest to just change the description and go on with this with another Kata, both are great but not mixed ;)
How is it possible that going to North => West => South => East doesn't lead to the starting point, so [] should be the return value?
Exactly the same solution I came with. Best for sure :D
This was a bit hard to understand at somepoint (more because of my fault than the exercise itself), but really amazing to solve. Would be great if we can solve the next
version in Rust.
Thanks for the Kata!
This comment is hidden because it contains spoiler information about the solution
We went into pretty much the same kind of solution. Bitness rocks :D