I know how I can reverse a string in ruby without the reverse method
def reverse(string)
string.each_char.inject(""){|str, char| str.insert(0, char) }
end
puts reverse('hello world')
but is there a way I can reverse only the odd indices to look like this.
output: hlloo wlred