1. 2
  1.  

  2. 1

    For test_find_answer_functions, you could’ve also used a function like this instead of a macro:

    fn test_functions<O, I>(expected: O, input: I, functions: &[Box<dyn FnOnce(I) -> O>]) {
      for f in functions {
        assert_eq!(expected, f(input));
      }
    }
    
    test_functions(
      // The answer based on the list below
      4,
      // The test's input data
      &[3, 3, 4, 2, 4, 4, 2, 4, 4],
      // The names of the functions I want to test
      &[
        find_answer_1,
        find_answer_2,
        find_answer_3,
        find_answer_4
        // Add another function name here whenever it's created
      ]
    );
    

    I haven’t tested if that particular code works, but something like it should.