fixed a thing i didint like fo solution of day 1

This commit is contained in:
Alie 2023-12-02 09:14:16 +01:00
parent 87893a52ff
commit 92b606a9ff
1 changed files with 9 additions and 8 deletions

View File

@ -28,19 +28,20 @@ fn parse(input: &str) -> Vec<i32> {
.collect::<Vec<_>>()
}
const NUMTEXT: [(&str, &str); 12] = [
("four", "4"),
("seven", "7"),
const NUMTEXT: [(&str, &str); 13] = [
("e", "ee"),
("nine", "9"),
("five", "5"),
("t", "tt"),
("three", "3"),
("eight", "8"),
("o", "oo"),
("one", "1"),
("n", "nn"),
("onne", "1"),
("two", "2"),
("three", "3"),
("foour", "4"),
("five", "5"),
("six", "6"),
("seeveen", "7"),
("eight", "8"),
("ninne", "9"),
];
fn text2digits(input: &str) -> String {
input