/**
 * Given a string s and a target letter, return the frequency of the target letter in the given string.
 */
fun calculateFrequency(s: String, target: Char): Int {

    var count = 0
    for (i in s.indices) {
        for (j in i until s.length) {
            if (s[j] == target) {
                count++
            }
        }
    }
    return count
}

// Let's test the function
/**
 * Given a string s and a target letter, return the frequency of the target letter in the given string.
 */
fun calculateFrequency(s: String, target: Char): Int {
/**
 * Given a string s and a target letter, return the frequency of the target letter in the given string.
 */
fun calculateFrequency(s: String, target: Char): Int {

    var count = 0
    for (i in s.indices) {
        for (j in i until s.length) {
            if (s[j] == target) {
                count++
            }
        }
    }
    return count
}

// Let's test the function