Sha256: 2830d9321c8ff87a01aafd304ece51cb7fa9b9f9fa79551ca3c3c84e47b3e2e6

Contents?: true

Size: 317 Bytes

Versions: 203

Compression:

Stored size: 317 Bytes

Contents

class Anagram(word: String) {
  def matches(anagrams: Seq[String]) =
    anagrams.filter(doesMatch).filterNot(isIdentical)

  private def doesMatch(anagram: String) =
    anagram.toLowerCase.sorted == word.toLowerCase.sorted

  private def isIdentical(anagram: String) =
    anagram.toLowerCase == word.toLowerCase
}

Version data entries

203 entries across 203 versions & 1 rubygems

Version Path
trackler-2.1.0.48 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.47 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.46 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.45 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.44 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.43 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.42 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.41 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.40 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.39 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.38 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.37 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.36 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.34 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.33 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.32 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.31 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.30 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.29 tracks/scala/exercises/anagram/example.scala
trackler-2.1.0.28 tracks/scala/exercises/anagram/example.scala