This commit is contained in:
8
src/s0009_palindrome_number.cpp
Normal file
8
src/s0009_palindrome_number.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "s0009_palindrome_number.hpp"
|
||||
|
||||
bool Solution::isPalindrome(int x) {
|
||||
string s = to_string(x);
|
||||
string r = s;
|
||||
reverse(r.begin(), r.end());
|
||||
return s == r;
|
||||
}
|
Reference in New Issue
Block a user