Untitled
fun checkSameCharacters(text: String): String { val map = mutableSetOf<Char>() var onlyUniqueChars = true run loop@{ text.forEach { if (map.contains(it)) { onlyUniqueChars = false return@loop } else { map.add(it) } } } return if (onlyUniqueChars) text.reversed() else text }