refactor: programmatically remove the first unwanted " in problem 42
This commit is contained in:
parent
93c73bb132
commit
62ae6f8690
1 changed files with 4 additions and 1 deletions
|
@ -8,8 +8,11 @@ fn main() {
|
||||||
characters.push(c);
|
characters.push(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
let contents = fs::read_to_string("assets/input")
|
let mut contents = fs::read_to_string("assets/input")
|
||||||
.expect("Could not read the input file").replace("\"\n", "");
|
.expect("Could not read the input file").replace("\"\n", "");
|
||||||
|
if contents.len() > 0 {
|
||||||
|
contents.remove(0);
|
||||||
|
}
|
||||||
let words = contents.split("\",\"").collect::<Vec<&str>>();
|
let words = contents.split("\",\"").collect::<Vec<&str>>();
|
||||||
|
|
||||||
let mut triangles = 0;
|
let mut triangles = 0;
|
||||||
|
|
Loading…
Reference in a new issue