A : 2147447412 Your function returned the following : 0 The expected returned val


#1

A : 2147447412
Your function returned the following :
0
The expected returned value :
1


#2

Read problem statement again :slight_smile:


#3

I didn’t get . Plese explain .


#4

It is not 2147447412 in test case, it is -2147447412, which is negative.
Now see expected output of -ve integer. :slight_smile:


#5

how is ‘2147447412’ ‘-2147447412’ can you explain??


#6

It’s not that the number is negative. The problem statement says that the output should be True|False, yet the testing requires 1|0.

Return 1 or 0 instead of True or False


#7

Same issue here with input A : 2147447412
My code returns 0, but for some reason it wants 1.
I’ve added a test for negative numbers as well.


#8

I think while comparison, you are comparing your reverse value not with the initial value of A.
Because every time you would be changing A by dividing it by 10.


#9

Make sure you are doing typecasting, following is for C# :
if((int)array[i]!=(int)array[array.Count-1-i]){
return 0;
}