@@ -13,7 +13,7 @@ fn parse(input: &str) -> Result<(Vec<String>, Vec<String>), AocError> {
1313 Ok ( ( towels, designs) )
1414}
1515
16- fn count_possible ( towels : & [ String ] , design : & str , cache : & mut HashMap < String , usize > ) -> usize {
16+ fn count_possible ( towels : & [ String ] , design : & str , cache : & mut HashMap < String , u64 > ) -> u64 {
1717 if design. is_empty ( ) {
1818 return 1 ;
1919 }
@@ -35,26 +35,26 @@ fn count_possible(towels: &[String], design: &str, cache: &mut HashMap<String, u
3535
3636pub struct Day19 ;
3737impl Solution for Day19 {
38- type A = usize ;
39- type B = usize ;
38+ type A = u64 ;
39+ type B = u64 ;
4040
4141 fn default_input ( & self ) -> & ' static str {
4242 include_str ! ( "../../../inputs/2024/day19.txt" )
4343 }
4444
45- fn part_1 ( & self , input : & str ) -> Result < usize , AocError > {
45+ fn part_1 ( & self , input : & str ) -> Result < u64 , AocError > {
4646 let ( towels, designs) = parse ( input) ?;
4747
4848 let mut cache = HashMap :: new ( ) ;
4949 let possible = designs
5050 . iter ( )
5151 . filter ( |design| count_possible ( & towels, design, & mut cache) > 0 )
52- . count ( ) ;
52+ . count ( ) as u64 ;
5353
5454 Ok ( possible)
5555 }
5656
57- fn part_2 ( & self , input : & str ) -> Result < usize , AocError > {
57+ fn part_2 ( & self , input : & str ) -> Result < u64 , AocError > {
5858 let ( towels, designs) = parse ( input) ?;
5959
6060 let mut cache = HashMap :: new ( ) ;
0 commit comments