Fixed an error
This commit is contained in:
@@ -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' {
|
||||
|
||||
Reference in New Issue
Block a user