Having an or to pleas a troll/friend :p
This commit is contained in:
parent
5661ba3f2f
commit
157b334b14
@ -11,7 +11,7 @@ pub fn solve_part1(file_path: &str) -> i32 {
|
|||||||
let (first, last) = item.split_at(item.len() / 2);
|
let (first, last) = item.split_at(item.len() / 2);
|
||||||
let second = last.chars().collect::<HashSet<char>>();
|
let second = last.chars().collect::<HashSet<char>>();
|
||||||
let intersection = first.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) {
|
if character >= ('a' as i32) {
|
||||||
character - 96
|
character - 96
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user