I got this problem in one of the coding questions in my university exam where I knew the answer but couldn\'t follow as I didn\'t know how to parse the string and convert it