/**
 * Given a list 'lst' and a value 'n', write a function to find the index of the first occurrence of 'n' in 'lst'.
 * The function should return -1 if 'n' is not found in 'lst'.
 *
 * Your task is to complete the 'index' function.
 *
 * Example:
 * index(3, listOf(1, 2, 3, 4, 5)) -> 2
 * index(6, listOf(1, 2, 3, 4, 5)) -> -1
 */
fun index(n: Int, lst: List<Int>): Int {

    for (i in lst.indices) {
        if (lst[i] == n) {
            return i
        }
    }
    return -1
}
/**
 * Given a list 'lst' and a value 'n', write a function to find the index of the first occurrence of 'n' in 'lst'.
 * The function should return -1 if 'n' is not found in 'lst'.
 *
 * Your task is to complete the 'index' function.
 *
 * Example:
 * index(3, listOf(1, 2, 3, 4, 5)) -> 2
 * index(6, listOf(1, 2, 3, 4, 5)) -> -1
 */
fun index(n: Int, lst: List<Int>): Int {
/**
 * Given a list 'lst' and a value 'n', write a function to find the index of the first occurrence of 'n' in 'lst'.
 * The function should return -1 if 'n' is not found in 'lst'.
 *
 * Your task is to complete the 'index' function.
 *
 * Example:
 * index(3, listOf(1, 2, 3, 4, 5)) -> 2
 * index(6, listOf(1, 2, 3, 4, 5)) -> -1
 */
fun index(n: Int, lst: List<Int>): Int {

    for (i in lst.indices) {
        if (lst[i] == n) {
            return i
        }
    }
    return -1
}