Skip to content

Instantly share code, notes, and snippets.

@mdrokz
Created May 29, 2023 04:51
Show Gist options
  • Save mdrokz/2eac9e447acebaaaa54cbe6e23f4030f to your computer and use it in GitHub Desktop.
Save mdrokz/2eac9e447acebaaaa54cbe6e23f4030f to your computer and use it in GitHub Desktop.
Leetcode problem 9 Palindrome number implemented in rust
impl Solution {
pub fn is_palindrome(x: i32) -> bool {
let y = x.to_string();
let rev = y.chars().rev().collect::<String>();
y == rev
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment