solutions: 4

This commit is contained in:
Muhammad Nauman Raza 2024-11-20 08:36:13 +00:00
parent e250be74f0
commit cd8e40d2ca
Signed by: devraza
GPG key ID: 91EAD6081011574B

View file

@ -0,0 +1,16 @@
fn main() {
let mut product: i64 = 0;
for i in 1..=999 {
for j in 1..=999 {
let product_string: String = format!("{:?}", i*j);
let reversed_string = product_string.chars().rev().collect::<String>();
if i*j > product && reversed_string == product_string {
product = i*j;
}
}
}
println!("{}", product);
}