Without using library functions


In real life interviews/coding tests, are we allowed to use inbuilt functions in this type of question? In this question, if we use all the required functions, it will be merely a 3/4 line code and if we don’t, it will turn out to be a tedious one. Please do share your thoughts regarding this.


You can’t use inbuilt functions .


you should probably use inbuilt function to parse the string to int. other than that it should be 3-5 lines using bitshift