/**
 * Given two lists, find and return the common elements between them.
 * The function should skip any negative numbers encountered and move to the next iteration.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list containing the common elements between list1 and list2.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()  // Initialize an empty list to store the common elements

    for (num1 in list1) {
        if (num1 < 0) {
            // Skip all negative numbers
            continue
        }

        for (num2 in list2) {
            if (num2 < 0) {
                // Skip all negative numbers
                continue
            }

            if (num1 == num2) {
                commonElements.add(num1)
            }
        }
    }

    return commonElements
}
/**
 * Given two lists, find and return the common elements between them.
 * The function should skip any negative numbers encountered and move to the next iteration.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list containing the common elements between list1 and list2.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Given two lists, find and return the common elements between them.
 * The function should skip any negative numbers encountered and move to the next iteration.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list containing the common elements between list1 and list2.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()  // Initialize an empty list to store the common elements

    for (num1 in list1) {
        if (num1 < 0) {
            // Skip all negative numbers
            continue
        }

        for (num2 in list2) {
            if (num2 < 0) {
                // Skip all negative numbers
                continue
            }

            if (num1 == num2) {
                commonElements.add(num1)
            }
        }
    }

    return commonElements
}