June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -1,7 +1,9 @@
|
|||
// version 1.2.0
|
||||
|
||||
import java.io.File
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val words = File("/usr/share/dict/words").readLines().toSet()
|
||||
val words = File("unixdict.txt").readLines().toSet()
|
||||
val pairs = words.map { Pair(it, it.reversed()) }
|
||||
.filter { it.first < it.second && it.second in words } // avoid dupes+palindromes, find matches
|
||||
println("Found ${pairs.size} semordnilap pairs")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue