fn solution(mut x: i32) -> bool { x.to_string().chars().into_iter().position(|s| s == '3').map_or(false, |_| true) } /* fn solution(mut x: i32) -> bool { while x != 0 { if x - x/10 == 3 { return true; } } false } */
- fn solution(mut x: i32) -> bool {
match x.to_string().chars().into_iter().position(|s| s == '3') {Some(_t) => true,_e => false,- x.to_string().chars().into_iter().position(|s| s == '3').map_or(false, |_| true)
- }
- /*
- fn solution(mut x: i32) -> bool {
- while x != 0 {
- if x - x/10 == 3 {
- return true;
- }
- }
}- false
- }
- */