From a5d02f8b9a1348cc6744f4f13eccaf1073289373 Mon Sep 17 00:00:00 2001 From: Reyaz Date: Sun, 13 Oct 2019 22:20:10 +0530 Subject: [PATCH] Added Solution for problem #9 --- #9/cpp/Solution.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 #9/cpp/Solution.cpp diff --git a/#9/cpp/Solution.cpp b/#9/cpp/Solution.cpp new file mode 100644 index 0000000..f3aa3e1 --- /dev/null +++ b/#9/cpp/Solution.cpp @@ -0,0 +1,20 @@ +class Solution { +public: + bool isPalindrome(long long x) { + long long n = 0, temp = 0, org = x; + // cout<= 0) { + while(x != 0) { + temp = x%10; + n = n*10 + temp; + x /= 10; + // cout<