So the question is giving a BIG string, break it up, find the palindromes and then find the shortest length within those sets of palindromes. Here's the code

Main Function

```
fun main(){
    val bigArray = "Simple, given a string of words, return the length of acdca the " +
            "shortest valav words String will never be empty and you do not need dad to account for different data types."

    println(leastP(bigArray))
}

```

The Custom Function

```
fun leastP(s: String): Int {
    val sSplit = listOf(s.split(""))
    val newArray = listOf<String>()

    for (i in sSplit){
        for (j in i.indices){
            if (isPalindrome3(i[j])) newArray.plus(j)
        }
    }

    return newArray.minOf { it.length }

}

    private fun isPalindrome3(s: String): Boolean {
        var i = 0
        var j = s.length -1
        while (i < j){
            if (s[i++].lowercaseChar() != s[j--].lowercaseChar()) return false
        }
        return true
    }

} 

```

I get this error

[![enter image description here](https://i.stack.imgur.com/d1Ihn.jpg)](https://i.stack.imgur.com/d1Ihn.jpg)

Not sure whats going on or where I messed up. Any help is appreciated.