1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/// Trait for a challenge
/// It is generic over `R` which is the type of the result.
/// So this trait can be implemented for challenges with different result types (eg. Integers or Strings).
/// The trait implements two functions, `part1` and `part2`, which are used to provide the solution to the respective part of the challenge.
///
/// The functions take a `Vec<String>` as input and return an `Option<R>`.
/// The input is the input data for the challenge and is provided by the `InputLoader`.
///
/// The functions return an `Option<R>` because the challenge might not be implemented for the respective part.
/// If the challenge is not implemented, the function should return `None`.
///
/// The function also take a mutable reference to `self` as input.
///
/// The Object implementing this trait is used to provide the solution to the challenge.
/// This object is created by the user and passed to the `AOCRunner`.
///
/// # Examples
/// ```
/// use aoc_runner::{Challenge, ChallengePart};
/// struct Solution;
///
/// impl Challenge<i32> for Solution {
/// fn part1(&mut self, input: Vec<String>) -> Option<i32> {
/// Some(0)
/// }
/// }
///
/// fn main() {
/// AOCRunner::new(Solution::new())
/// .run(from_file("input.txt")); //Returns 0 for first part of the challenge. Then asks for feedback. Then states that the second part is not implemented.
/// }
/// Enum for the two parts of the challenge
/// Used to provide the part of the challenge when adding examples