advent_of_code_2024::day_2

Function report_check_with_dampener

source
fn report_check_with_dampener(report: &Vec<u32>) -> bool
Expand description

If the report is unsafe, it can be considered safe enough if it becomes safe when removing one level.

The level to remove must be one of the pair that causes the initial check to fail, or the first level in the report if that causes the first step to be in the wrong direction.