leetcode/src/s0009_palindrome_number.cpp
Sainnhe Park c214c8dff4
Some checks failed
continuous-integration/drone/push Build is failing
s0009
2022-11-02 22:20:09 +08:00

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;
}