Kotlin Sugar Style
Code

# Code
```kotlin []
class Solution {
    fun smallestString(s: String): String = smallestStringProdVariant(s)
    fun smallestStringProdVariant(s: String): String {
        val firstNonAIndex = s.indexOfFirst { it != 'a' }

        return if (firstNonAIndex == -1) {
            s.dropLast(1) + 'z'
        } else {
            val modifiedChars = s.toCharArray().also { chars ->
                for (i in firstNonAIndex until chars.size) {
                    if (chars[i] != 'a') {
                        chars[i]--
                    } else {
                        break
                    }
                }
            }
            String(modifiedChars)
        }
    }

    fun String.hasSingle(): Boolean = when {
        this.length == 1 -> true
        else -> false
    }
}
```
['Kotlin']