/**
 * This function takes in a string and a target substring, and returns the index of the first occurrence
 * of the target substring in the given string. If the target substring is not found, it returns -1.
 */
fun indexString(txt: String, target: String): Int {

    // Check if the target substring is empty
    if (target.isEmpty()) {
        return 0
    }

    // Iterate over the string to find the index of the target substring
    for (i in txt.indices) {
        if (txt.substring(i, i + target.length) == target) {
            return i
        }
    }

    return -1
}
/**
 * This function takes in a string and a target substring, and returns the index of the first occurrence
 * of the target substring in the given string. If the target substring is not found, it returns -1.
 */
fun indexString(txt: String, target: String): Int {
/**
 * This function takes in a string and a target substring, and returns the index of the first occurrence
 * of the target substring in the given string. If the target substring is not found, it returns -1.
 */
fun indexString(txt: String, target: String): Int {

    // Check if the target substring is empty
    if (target.isEmpty()) {
        return 0
    }

    // Iterate over the string to find the index of the target substring
    for (i in txt.indices) {
        if (txt.substring(i, i + target.length) == target) {
            return i
        }
    }

    return -1
}