part2 (1550B)
1--- Part Two --- 2 3Considering every single measurement isn't as useful as you expected: there's just too much noise in 4the data. 5 6Instead, consider sums of a [1m[37mthree-measurement sliding window[0m. Again considering the 7above example: 8 9199 A 10200 A B 11208 A B C 12210 B C D 13200 E C D 14207 E F D 15240 E F G 16269 F G H 17260 G H 18263 H 19 20Start by comparing the first and second three-measurement windows. The measurements in the first 21window are marked A (199, 200, 208); their sum is 199 + 200 + 208 = 607. The second window is marked 22B (200, 208, 210); its sum is 618. The sum of measurements in the second window is larger than the 23sum of the first, so this first comparison [1m[37mincreased[0m. 24 25Your goal now is to count [1m[37mthe number of times the sum of measurements in this sliding 26window increases[0m from the previous sum. So, compare A with B, then compare B with C, then C with 27D, and so on. Stop when there aren't enough measurements left to create a new three-measurement sum. 28 29In the above example, the sum of each three-measurement window is as follows: 30 31A: 607 (N/A - no previous sum) 32B: 618 ([1m[37mincreased[0m) 33C: 618 (no change) 34D: 617 (decreased) 35E: 647 ([1m[37mincreased[0m) 36F: 716 ([1m[37mincreased[0m) 37G: 769 ([1m[37mincreased[0m) 38H: 792 ([1m[37mincreased[0m) 39 40In this example, there are [1m[37m5[0m sums that are larger than the previous sum. 41 42Consider sums of a three-measurement sliding window. [1m[37mHow many sums are larger than the 43previous sum?[0m 44 45