File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ fn main() {
1111 if stone == 0 {
1212 new_stones << 1
1313 } else {
14- digits := if stone == 10 { 1 } else { int (math.log10 (stone)) }
14+ digits := if stone == 10 { 1 } else { int (math.log10 (f64 ( stone) )) }
1515 if digits % 2 == 1 {
1616 power := i64 (math.pow (10 , digits / 2 + 1 ))
1717 new_stones << stone / power
@@ -56,7 +56,7 @@ fn (mut b Bruteforcer) force(stone i64, rem int) i64 {
5656 total = b.force (1 , rem - 1 )
5757 } else {
5858 // math.log10(10) is 0.9999999999 and rounds down to 0....
59- digits := if stone == 10 { 1 } else { int (math.log10 (stone)) }
59+ digits := if stone == 10 { 1 } else { int (math.log10 (f64 ( stone) )) }
6060 if digits % 2 == 1 {
6161 power := i64 (math.pow (10 , digits / 2 + 1 ))
6262 total = b.force (stone / power, rem - 1 ) + b.force (stone % power, rem - 1 )
You can’t perform that action at this time.
0 commit comments