Ad
Fundamentals
Games
Code
Diff
  • def riddle(word)
      word.count "a-zA-Z"
    end
    • def riddle(w) = /\?/ =~ w
    • def riddle(word)
    • word.count "a-zA-Z"
    • end
Code
Diff
  • def one_away(a, b)
      (a.chars - b.chars).count <= 1 ? true : false
    end
    • def one_away(a,b)
    • (a.split('')-b.split('')).count <= 1 ? true : false
    • def one_away(a, b)
    • (a.chars - b.chars).count <= 1 ? true : false
    • end