summaryrefslogtreecommitdiff
path: root/rust/src/bin/p0009.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/bin/p0009.rs')
-rw-r--r--rust/src/bin/p0009.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/rust/src/bin/p0009.rs b/rust/src/bin/p0009.rs
new file mode 100644
index 0000000..4ecb473
--- /dev/null
+++ b/rust/src/bin/p0009.rs
@@ -0,0 +1,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() {} \ No newline at end of file