Microsoft Interview Question

write a function to turn int to string and another function to turn string to int. I.e. intToString(int n) and stringToInt(string s)

Interview Answer

Anonymous

Apr 22, 2017

just write code, simple question. One thing that need to be considered is that in intToString(int n) -INT_MIN is larger than INT_MAX, so you should use type 'long long' to store value in case there might be overflow.