aylei / leetcode-rust

my leetcode solutions in rust
Apache License 2.0
717 stars 141 forks source link

Manipulating rust iterators #22

Open maicallist opened 4 years ago

maicallist commented 4 years ago

Hi,

Out of interest, I read one of your solution s0007.

I was given the impression from problem desc that a solution would be like

str.push('-');
str[1..].chars().rev().collect::<String>().parse().unwrap_or(0)

Your code is much like c than rust.