Love to work on the challenges, please keep this series running.
Here's my Rust Solution: Playground
fnmain(){letmax=max_palindrome();println!("Max palindrome is {}, product of {} * {}",max.1,(max.0).0,(max.0).1);}fnmax_palindrome()->((i32,i32),i32){letrange=100..1000;letmutans=((0,0),0);forainrange.clone(){forbinrange.clone(){letp=a*b;ifis_palindrome(p)&&p>ans.1{ans.1=p;ans.0=(a,b);}}}ans}fnis_palindrome(num:i32)->bool{letstr_num=num.to_string();str_num.chars().zip(str_num.chars().rev()).all(|(c1,c2)|c1==c2)}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Love to work on the challenges, please keep this series running.
Here's my Rust Solution: Playground