/**
 * Given a list of numbers and an integer 'n', divide each number in the list by 'n'.
 * Return a new list of the division results. If a number in the list is equal to or less than 0,
 * append null to the new list instead.
 *
 * @param numList A list of numbers.
 * @param n An integer to divide by.
 * @return A new list containing the division results with null for numbers less than or equal to 0.
 */
fun divideByN(numList: List<Int>, n: Int): List<Float?> {

    val resultList = mutableListOf<Float?>()

    for (num in numList) {
        if (num <= 0) {
            resultList.add(null)
        } else {
            resultList.add(num.toFloat() / n)
        }
    }

    return resultList
}
/**
 * Given a list of numbers and an integer 'n', divide each number in the list by 'n'.
 * Return a new list of the division results. If a number in the list is equal to or less than 0,
 * append null to the new list instead.
 *
 * @param numList A list of numbers.
 * @param n An integer to divide by.
 * @return A new list containing the division results with null for numbers less than or equal to 0.
 */
fun divideByN(numList: List<Int>, n: Int): List<Float?> {
/**
 * Given a list of numbers and an integer 'n', divide each number in the list by 'n'.
 * Return a new list of the division results. If a number in the list is equal to or less than 0,
 * append null to the new list instead.
 *
 * @param numList A list of numbers.
 * @param n An integer to divide by.
 * @return A new list containing the division results with null for numbers less than or equal to 0.
 */
fun divideByN(numList: List<Int>, n: Int): List<Float?> {

    val resultList = mutableListOf<Float?>()

    for (num in numList) {
        if (num <= 0) {
            resultList.add(null)
        } else {
            resultList.add(num.toFloat() / n)
        }
    }

    return resultList
}