Skip to content

Commit d5f3f1c

Browse files
committed
chore(04/2025): init day
1 parent 0fedfd2 commit d5f3f1c

File tree

5 files changed

+38
-6
lines changed

5 files changed

+38
-6
lines changed

readme.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99

1010
# 2025
1111

12-
| Day | Solved | Part 1 time (ms) | Part 2 time (ms) |
13-
|-----------------------------------------------------------|:------:|-----------------:|-----------------:|
14-
| [Day 1: Secret Entrance](src/solutions/year2025/day01.rs) || 0.144 | - |
15-
| [Day 2: Gift Shop](src/solutions/year2025/day02.rs) | ⭐⭐ | 65.103 | 81.719 |
16-
| [Day 3: Lobby](src/solutions/year2025/day03.rs) | ⭐⭐ | 0.131 | 0.133 |
12+
| Day | Solved | Part 1 time (ms) | Part 2 time (ms) |
13+
|---------------------------------------------------------------|:------:|-----------------:|-----------------:|
14+
| [Day 1: Secret Entrance](src/solutions/year2025/day01.rs) || 0.144 | - |
15+
| [Day 2: Gift Shop](src/solutions/year2025/day02.rs) | ⭐⭐ | 65.103 | 81.719 |
16+
| [Day 3: Lobby](src/solutions/year2025/day03.rs) | ⭐⭐ | 0.131 | 0.133 |
17+
| [Day 4: Printing Department](src/solutions/year2025/day04.rs) | - | - | - |
1718

1819
# 2024
1920

src/solutions/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub fn solution(puzzle_day: PuzzleDay) -> Box<dyn Solution> {
1818
1 => Box::new(year2025::day01::Day01),
1919
2 => Box::new(year2025::day02::Day02),
2020
3 => Box::new(year2025::day03::Day03),
21+
4 => Box::new(year2025::day04::Day04),
2122
_ => panic!("Day not exist"),
2223
},
2324
Year::Year2024 => match i {

src/solutions/year2025/day03.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ impl Day03 {
7474
let search_slice = &numbers[start_index..=end_index];
7575

7676
let max_digit = *search_slice.iter().max().unwrap();
77-
let max_digit_offset = search_slice.iter().position(|&digit| digit == max_digit).unwrap();
77+
let max_digit_offset = search_slice
78+
.iter()
79+
.position(|&digit| digit == max_digit)
80+
.unwrap();
7881

7982
result_digits.push(max_digit);
8083
start_index += max_digit_offset + 1;

src/solutions/year2025/day04.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use crate::solutions::Solution;
2+
3+
pub struct Day04;
4+
5+
impl Solution for Day04 {
6+
fn part_one(&self, _input: &str) -> String {
7+
String::from("0")
8+
}
9+
10+
fn part_two(&self, _input: &str) -> String {
11+
String::from("0")
12+
}
13+
}
14+
15+
#[cfg(test)]
16+
mod tests {
17+
use crate::solutions::year2025::day04::Day04;
18+
use crate::solutions::Solution;
19+
20+
const EXAMPLE: &str = r#""#;
21+
22+
#[test]
23+
fn part_one_example_test() {
24+
assert_eq!("0", Day04.part_one(EXAMPLE));
25+
}
26+
}

src/solutions/year2025/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pub mod day01;
22
pub mod day02;
33
pub mod day03;
4+
pub mod day04;

0 commit comments

Comments
 (0)