2021 day8/rust: only trim start of output digits

This commit is contained in:
Xiretza 2021-12-09 18:05:40 +01:00
parent 92aba2db95
commit edd8bdfa71

View file

@ -32,7 +32,7 @@ pub fn unscramble(line: &str) -> LineResult {
let digits = parts
.next()
.unwrap()
.trim()
.trim_start()
.split(' ')
.map(|s| s.bytes().map(|c| counts[c as usize - b'a' as usize]).sum())
.map(|n: usize| FREQ_TABLE[n])