Pergunta de entrevista da empresa Amazon

1.reverse a string word by word and there may be multiple whitespace between two word, keep exactly the same whitespace when reverse string by word 2.find all prime number less than the give input k