1
0
Fork 0

Having an or to pleas a troll/friend :p

This commit is contained in:
Pcornat 2022-12-05 21:58:25 +01:00
parent 5661ba3f2f
commit 157b334b14
Signed by: Pcornat
GPG Key ID: 2F3932FF46D9ECA0
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ pub fn solve_part1(file_path: &str) -> i32 {
let (first, last) = item.split_at(item.len() / 2);
let second = last.chars().collect::<HashSet<char>>();
let intersection = first.chars().collect::<HashSet<char>>();
let character = *intersection.intersection(&second).next().unwrap() as i32;
let character = *intersection.intersection(&second).next().unwrap_or(&(0 as char)) as i32;
if character >= ('a' as i32) {
character - 96
} else {