Function advent_solutions::advent2017::day02::part2 [] [src]

pub fn part2<'a, I, J>(lines: I) -> usize where
    I: IntoIterator<Item = J>,
    J: IntoIterator<Item = &'a usize> + Copy

"Great work; looks like we're on the right track after all. Here's a star for your effort." However, the program seems a little worried. Can programs be worried?

"Based on what we're seeing, it looks like all the User wanted is some information about the evenly divisible values in the spreadsheet. Unfortunately, none of us are equipped for that kind of calculation - most of us specialize in bitwise operations."

It sounds like the goal is to find the only two numbers in each row where one evenly divides the other - that is, where the result of the division operation is a whole number. They would like you to find those numbers on each line, divide them, and add up each line's result.

For example, given the following spreadsheet:

5 9 2 8
9 4 7 3
3 8 6 5

In this example, the sum of the results would be 4 + 3 + 2 = 9.

assert_eq!(part2(&parse_input(input)), 9);

What is the sum of each row's result in your puzzle input?