Rýchlosť Kotlin

PHOTO EMBED

Tue May 04 2021 07:42:52 GMT+0000 (UTC)

Saved by @GoodRequest.

fun countLetter(string: String, letter: Char): Int {
    var count = 0
    string.forEach {
        if (it == letter)
            count++
    }
    return count
}
content_copyCOPY