Convert the number string


Convert the number into a string then check whether the string is palindrome or not.


Wouldn’t you count it as an extra space? Since it is basically an array of chars of the number of digits.

string s=to_string(A);
int i,j,k=0,ans; int l=s.length();   vector <int> v;
return 1;
return 0;


Yes, it does.
For your own benefit, always see if it is running with extra space. Many times it happens that in coding exams these constraints are not hardly implemented. You will miss out marks just because others wrote it using space.


Wat!!!. I wasted 30min by not using extra space. They should implement their own rules or else it would be unfair to others who follows rules.