Skip to content

Instantly share code, notes, and snippets.

fun findSubFunctions(input: List<List<String>>, maxFunctionLength: Int, maxSubFunctions: Int): List<List<String>>? {
if (input.isEmpty()) {
return emptyList()
}
if (maxSubFunctions == 0) {
return null
}
for (i in 1..input[0].size) {
val candidate = input[0].subList(0, i)
if (candidate.joinToString(",").length > maxFunctionLength) {