Skip to content

Instantly share code, notes, and snippets.

import kotlin.random.Random
class RandomWordGenerator(words: List<String>) {
private val graph = mutableMapOf<Char, MutableSet<Char>>()
private val firstLetters = mutableSetOf<Char>()
private val lastLetters = mutableSetOf<Char>()
init {
words.forEach { word ->
word.forEachIndexed { index, currentLetter ->