Imagine a world inside mirror, where everything becomes reverse. Left hand becomes right hand, right hand becomes left hand. Mirror people read Arabic from left to write but they read English from right to left. In that world they have their own way of writing numbers as well. Fortunately, their numbers contain same digits (0,1,2,3,4,5,6,7,8 and 9) as our world, but they write it in a little bit different way than us. We write the digits of a number from left to right, but mirror people write it from right to left.
ok if i reverse it and compare there is an invalid case like
10000000000 1 they are equal ,but it will show 10000000000<1
so we have to do extra work to handle these tai zeroes!
In the sample test case it is given that 423 = 423;
but reversed 423 is 324 which is less than 423 (in our world)
I couldnt figure out what the problem is , please help me with this.
Actually strrev(str) is a C function defined in the header file string.h in C. You cannot include this in a C++ program. Yes, there are alternatives to this in C++, its called reverse which is defined under the header file algorithm(#include)