Fixed an error

This commit is contained in:
Connor Johnstone
2023-12-11 01:11:15 -07:00
parent 0be182c7f0
commit c566b5bb64

View File

@@ -147,7 +147,7 @@ pub fn part2(input: &str) -> String {
// L's cancel F's, J's cancel 7's
if count_map[[new_y,x]] != 0 {
// We can add either a half or full count
let next_character = std::str::from_utf8(&[input.as_bytes()[new_y*columns + x]]).unwrap().chars().next().unwrap();
let next_character = input.as_bytes()[new_y*(columns+1) + x] as char;
if ['7', 'S'].contains(&next_character) {
count_7 += 1;
} else if next_character == 'J' {