s0009
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2022-11-02 22:20:09 +08:00
parent 67d21139eb
commit c214c8dff4
3 changed files with 45 additions and 0 deletions

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