Pergunta de entrevista da empresa NVIDIA

finding the interger from a string which has all kinds of characters.