diff options
Diffstat (limited to '0009')
| -rw-r--r-- | 0009/Cargo.lock | 7 | ||||
| -rw-r--r-- | 0009/Cargo.toml | 6 | ||||
| -rw-r--r-- | 0009/src/main.rs | 13 |
3 files changed, 26 insertions, 0 deletions
diff --git a/0009/Cargo.lock b/0009/Cargo.lock new file mode 100644 index 0000000..adc6c9d --- /dev/null +++ b/0009/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "p9" +version = "0.1.0" diff --git a/0009/Cargo.toml b/0009/Cargo.toml new file mode 100644 index 0000000..7b36dc9 --- /dev/null +++ b/0009/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "p9" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/0009/src/main.rs b/0009/src/main.rs new file mode 100644 index 0000000..4ecb473 --- /dev/null +++ b/0009/src/main.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 |
