solutions: 56

This commit is contained in:
Muhammad Nauman Raza 2024-12-03 09:46:00 +00:00
parent c5dcb0eae6
commit d7f2e29b83
Signed by: devraza
GPG key ID: 91EAD6081011574B

View file

@ -0,0 +1,14 @@
use num_bigint::BigUint;
fn main() {
let mut sums: Vec<u32> = vec![];
for i in 1..100 {
for j in 1..100 {
let power = format!("{}", BigUint::from(i as u64).pow(j));
sums.push(power.chars().filter_map(|c| c.to_digit(10)).sum());
}
}
println!("{}", sums.iter().max().unwrap());
}