diff --git a/LeetCode/Palindrome Number.cpp b/LeetCode/Palindrome Number.cpp new file mode 100644 index 0000000..223e526 --- /dev/null +++ b/LeetCode/Palindrome Number.cpp @@ -0,0 +1,15 @@ +class Solution { +public: + bool isPalindrome(int x) { + if(x<0) return false; + if(x<10) return true; + int i=0; + string s = to_string(x); + int length = s.length(); + for(i=0; i