Microsoft interview question

Write code that reverses words in a string.

Interview Answers

Anonymous

Dec 8, 2016

$string = "Write code that reverses words in a string" $words = $string -split " " [array]::Reverse($words) $words -join " "

1

Anonymous

Feb 20, 2019

print(string1[::-1])

Anonymous

Dec 30, 2016

string.split('').reverse().join('')