We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6aaf1d commit 64fcd13Copy full SHA for 64fcd13
src/main/scala/forcomp/Anagrams.scala
@@ -34,7 +34,7 @@ object Anagrams {
34
* same character, and are represented as a lowercase character in the occurrence list.
35
*/
36
def wordOccurrences(w: Word): Occurrences =
37
- w.groupBy(x => x).toList map ({case (c,l) => (c,l.length)}) sorted
+ w.toLowerCase.groupBy(x => x).toList map ({case (c,l) => (c,l.length)}) sorted
38
39
/** Converts a sentence into its character occurrence list. */
40
def sentenceOccurrences(s: Sentence): Occurrences = ???
0 commit comments