/**
 * Given a list of integers, find the index of the maximum negative number present.
 */
fun findMaxNegativeIndex(data: List<Int>): Int {

    var maxNegative = Int.MIN_VALUE
    var maxNegativeIndex = -1

    for ((index, num) in data.withIndex()) {
        if (num < 0 && num > maxNegative) {
            maxNegative = num
            maxNegativeIndex = index
        }
    }

    return maxNegativeIndex
}
/**
 * Given a list of integers, find the index of the maximum negative number present.
 */
fun findMaxNegativeIndex(data: List<Int>): Int {
/**
 * Given a list of integers, find the index of the maximum negative number present.
 */
fun findMaxNegativeIndex(data: List<Int>): Int {

    var maxNegative = Int.MIN_VALUE
    var maxNegativeIndex = -1

    for ((index, num) in data.withIndex()) {
        if (num < 0 && num > maxNegative) {
            maxNegative = num
            maxNegativeIndex = index
        }
    }

    return maxNegativeIndex
}