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

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

The spreadsheet consists of rows of apparently-random numbers. To make sure the recovery process is on the right track, they need you to calculate the spreadsheet's checksum. For each row, determine the difference between the largest value and the smallest value; the checksum is the sum of all of these differences.

For example, given the following spreadsheet:

5 1 9 5
7 5 3
2 4 6 8

In this example, the spreadsheet's checksum would be 8 + 4 + 6 = 18.

assert_eq!(part1(&parse_input(input)), 18);

What is the checksum for the spreadsheet in your puzzle input?