From 62789133d6fc7a9805c1a2e06d4bbafe7be32923 Mon Sep 17 00:00:00 2001 From: Luke Schoettinger Date: Fri, 10 May 2019 15:40:38 -0400 Subject: [PATCH] all done --- anagram_detector.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/anagram_detector.rb b/anagram_detector.rb index f67e128..e74f442 100644 --- a/anagram_detector.rb +++ b/anagram_detector.rb @@ -1,5 +1,7 @@ # Implement this in such a way that when called below, detect_anagram will result in true or false. -def canonical(word) +def canonical(word) + word.downcase.chars.sort + end def detect_anagram(word1, word2) @@ -12,5 +14,5 @@ def detect_anagram(word1, word2) p detect_anagram('pants', 'pants') == true p detect_anagram('CinEmA', 'iceman') == true p detect_anagram('defgh8', 'g8hefd') == true - +p detect_anagram('bird', 'house') == false