blob: 4ecb473558821109cb15deddc5e90339d1528de3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
impl Solution {
pub fn is_palindrome(x: i32) -> bool {
if x < 0 {
return false;
}
let s = x.to_string();
let rs: String = s.chars().rev().collect();
return s == rs;
}
}
struct Solution {}
fn main() {}
|