advent_of_code_2024::day_7

Function is_solvable

source
fn is_solvable(
    equation: &Equation,
    ops: &Vec<fn(_: i64, _: i64) -> Option<i64>>,
) -> bool
Expand description

Do depth-first search to solve the equation using permutations of the available operators, returning true if there is at least one permutation of operators that results in the target number. Operations must increase the total, or return None for all possible inputs.