Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Simple string reversal

source: Codewars

Prompt

Reverse a string while maintaining the spaces (if any) in their original place.

Example

solve("our code") = "edo cruo"
-- Normal reversal withotu spaces is "edocruo".
-- However, there is a space at index 3, so the string becomes "edo cruo"

solve("your code rocks") = "skco redo cruoy".
solve("codewars") = "srawedoc".