Pergunta de entrevista da empresa Jet

Reverse a string by word. For instance, given "The sky is blue", output "blue is sky The". Language didn't matter.

Respostas da entrevista

Sigiloso

15 de fev. de 2018

Opt 1. Parse the string, put in stack, pop to create reverse string. Opt 2. Parse the string, run for loop through array in reverse order

Sigiloso

22 de out. de 2018

def reverseWords(line): words = line.split()[::-1] return ' '.join(words)