[][src]Function advent_of_code::solve

pub fn solve(
    year: u16,
    day: u8,
    part: u8,
    input: &str
) -> Result<String, String>

Returns the solution for the specified given problem and input.

Arguments

  • year - The year of the problem, as in 2018 or 2019.
  • day - The day of the problem - from 1 to 25.
  • part - The part of the problem - either 1 or 2.
  • input - The input to the problem.

Examples

use advent_of_code::solve;
let solution = solve(2019, 1, 1, "14");
assert_eq!(solution, Ok("2".to_string()));