Posts Tagged ‘ruby’

Complicating the Situation

Monday, April 2nd, 2012 by ahorner

Sometimes it’s easy to make things too complicated.

def palindrome? value
  (0...value.length/2).each{ |i| return false if value[i] != value[-1 + -1*i] }
  true
end
def palindrome? value
  value == value.reverse
end