From 558f38fc2790bd4949cc298ac8dfb8f54a2b1042 Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Thu, 30 Jan 2025 22:54:59 +0000 Subject: [PATCH] solutions: 41A --- solutions/rust/src/bin/41A.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 solutions/rust/src/bin/41A.rs diff --git a/solutions/rust/src/bin/41A.rs b/solutions/rust/src/bin/41A.rs new file mode 100644 index 0000000..631c5c7 --- /dev/null +++ b/solutions/rust/src/bin/41A.rs @@ -0,0 +1,17 @@ +use std::io; + +fn main() { + let mut s1 = String::new(); + io::stdin().read_line(&mut s1).unwrap(); + + let mut s2 = String::new(); + io::stdin().read_line(&mut s2).unwrap(); + + let rev: String = s1.trim().chars().rev().collect(); + + if s2.trim() == rev { + println!("YES"); + } else { + println!("NO"); + } +}