Skip to content

Instantly share code, notes, and snippets.

class Solution {
public:
bool isPalindrome(int x) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
if(x<0) return false;
int counter=1;
while(x/counter>=10)
{
counter*=10;