From ffe7e5743521b392dec6f4e8672e607a7bfb6b2b Mon Sep 17 00:00:00 2001 From: Grant Payne Date: Fri, 24 May 2019 14:35:36 -0400 Subject: [PATCH] looks good --- anagram_detector.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/anagram_detector.rb b/anagram_detector.rb index f67e128..cba7551 100644 --- a/anagram_detector.rb +++ b/anagram_detector.rb @@ -1,5 +1,6 @@ # Implement this in such a way that when called below, detect_anagram will result in true or false. def canonical(word) + word.upcase.chars.sort.join end def detect_anagram(word1, word2) @@ -12,5 +13,6 @@ 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('asdfsa', 'x') == false