/**
 * Given a string and a target character, find the index of the last occurrence of the target character in the string.
 *
 * @param string The input string.
 * @param target The target character to find.
 * @return The index of the last occurrence of the target character. Returns -1 if target not found.
 */
fun findLastOccurrence(string: String, target: Char): Int {

    var index = string.length - 1
    while (index >= -string.length) {
        if (string[index] == target) {
            return index
        }
        index--
    }
    return -1
}
/**
 * Given a string and a target character, find the index of the last occurrence of the target character in the string.
 *
 * @param string The input string.
 * @param target The target character to find.
 * @return The index of the last occurrence of the target character. Returns -1 if target not found.
 */
fun findLastOccurrence(string: String, target: Char): Int {
/**
 * Given a string and a target character, find the index of the last occurrence of the target character in the string.
 *
 * @param string The input string.
 * @param target The target character to find.
 * @return The index of the last occurrence of the target character. Returns -1 if target not found.
 */
fun findLastOccurrence(string: String, target: Char): Int {

    var index = string.length - 1
    while (index >= -string.length) {
        if (string[index] == target) {
            return index
        }
        index--
    }
    return -1
}