9 lines
170 B
C++
9 lines
170 B
C++
#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;
|
|
}
|