/**
 * Returns the nth positive integer from the given list.
 *
 * @param n The position of the positive integer to be accessed.
 * @param lst A list of positive integers.
 * @return The nth positive integer from the list, or -1 if not found.
 */
fun getNthPositiveInteger(n: Int, lst: List<Int>): Int {

    // Check if the given list is empty or null
    if (lst.isEmpty()) {
        return -1
    }

    // Check if the given list has enough elements to access the nth position
    if (lst.size < n) {
        return -1
    }

    // Initialize a variable to keep track of the number of positive integers found so far
    var count = 0

    // Iterate through the list and count the positive integers
    for (num in lst) {
        if (num > 0) {
            count++

            // Check if the current positive integer is at the desired position
            if (count == n) {
                return num
            }
        }
    }

    // If the nth positive integer is not found, return -1
    return -1
}
/**
 * Returns the nth positive integer from the given list.
 *
 * @param n The position of the positive integer to be accessed.
 * @param lst A list of positive integers.
 * @return The nth positive integer from the list, or -1 if not found.
 */
fun getNthPositiveInteger(n: Int, lst: List<Int>): Int {
/**
 * Returns the nth positive integer from the given list.
 *
 * @param n The position of the positive integer to be accessed.
 * @param lst A list of positive integers.
 * @return The nth positive integer from the list, or -1 if not found.
 */
fun getNthPositiveInteger(n: Int, lst: List<Int>): Int {

    // Check if the given list is empty or null
    if (lst.isEmpty()) {
        return -1
    }

    // Check if the given list has enough elements to access the nth position
    if (lst.size < n) {
        return -1
    }

    // Initialize a variable to keep track of the number of positive integers found so far
    var count = 0

    // Iterate through the list and count the positive integers
    for (num in lst) {
        if (num > 0) {
            count++

            // Check if the current positive integer is at the desired position
            if (count == n) {
                return num
            }
        }
    }

    // If the nth positive integer is not found, return -1
    return -1
}