Below is my code and it is not correct for integer overflows…
But still they have accepted the solution.
Code:
int atoi(string A)
{
int x{0};
stringstream s(A);
s>>x;
return x;
}
Below is my code and it is not correct for integer overflows…
But still they have accepted the solution.
Code:
int atoi(string A)
{
int x{0};
stringstream s(A);
s>>x;
return x;
}