simple-exercises/ruby-exercises/very-easy.rb
# Write a method that takes a string and returns true if it is a
# palindrome. A palindrome is a string that is the same whether written
# backward or forward. Assume that there are no spaces; only lowercase
# letters will be given.
Write a method that takes a string and returns true if it is a
palindrome. A palindrome is a string that is the same whether written
backward or forward. Assume that there are no spaces; only lowercase
letters will be given.
Write a method that takes a string and returns true if it is a palindrome . A palindrome is a string that is the same whether written backward or forward . Assume that there are no spaces ; only lowercase letters will be given .
def palindrome? string
  n = string.length / 2
  (0..n).each do |i|
    if string[i] != string[-(i + 1)]
      return false
    end
  end
  true
end
def palindrome? string n = string . length / 2 ( 0 .. n ) . each do | i | if string [ i ] != string [ - ( i + 1 ) ] return false end end true end
Write a method that takes a string and returns true if it is a
palindrome.
Write a method that takes a string and returns true if it is a palindrome .
string
<not_specific>