practice-problems-1/no_comments/00-reverse.rb
# Write a method that will take a string as input, and return a new
# string with the same letters in reverse order.
#
# Don't use String's reverse method; that would be too simple.
#
# Difficulty: easy.
Write a method that will take a string as input, and return a new
string with the same letters in reverse order.

Don't use String's reverse method; that would be too simple.

easy.
Write a method that will take a string as input and return a new string with the same letters in reverse order . Don ' t use String ' s reverse method ; that would be too simple . easy .
def reverse(string)
  answer = ""
  range = string.length-1 
  range.downto(0) do |i|
    answer << string[i]
  end
  return answer
end
def reverse ( string ) answer = "" range = string . length - 1 range . downto ( 0 ) do | i | answer << string [ i ] end return answer end
Write a method that will take a string as input, and return a new
string with the same letters in reverse order.
Write a method that will take a string as input and return a new string with the same letters in reverse order .
string
<not_specific>