Novacoast Interview Question

Write a function that reverses a string of arbitrary size.

Interview Answers

Anonymous

Nov 15, 2018

You do this recursively

Anonymous

Nov 16, 2018

You can do this recursively, but if you're using python it is as easy as x = "hello world" x = x[::-1] Or if they want it in JavaScript, you can do var x = "hello world" x = x.split().reverse().join(""); Unless they do want you to do it without built-in functions, you can do it recursively or just get the length of the string and loop backwards.