This commit is contained in:
2023-12-04 12:01:05 +01:00
parent ebb2befa75
commit e9c32fd1fe
6 changed files with 323 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ use std::collections::HashMap;
use std::fs;
fn main() {
let content = fs::read_to_string("inputTest.txt").expect("Could not read file");
let content = fs::read_to_string("input.txt").expect("Could not read file");
let lines: Vec<&str> = content.lines().collect();
let mut output_sum = 0;
@@ -29,7 +29,7 @@ fn main() {
if let Some(line) = lines.get(index1) {
if index2 < lines[index1].len() {
if let Some(character) = line.chars().nth(index2) {
if character != '.' {
if character != '.' && !character.is_digit(10) {
output_sum += num;
// Part 2