/**
 * This exercise focuses on the intersection of "Representation of complex numbers in Python" and "Introduction to booleans".
 * Given a list of complex numbers, the function should perform complex boolean operations and return the result.
 *
 * @param complexNums A list of complex numbers represented as pairs of real and imaginary parts.
 * @return The boolean result of the complex operation.
 */
fun complexBooleanOperations(complexNums: List<Pair<Double, Double>>): Boolean {

    // Check if the list is empty
    if (complexNums.isEmpty()) {
        return false
    }

    // Perform complex boolean operations
    var result = true

    // Iterate through the list of complex numbers
    for (num in complexNums) {
        // Get the real and imaginary parts of the current complex number
        val (realPart, imagPart) = num

        // Perform complex boolean operations based on conditions
        result = when {
            realPart > 0 && imagPart <= 0 -> result && true
            realPart <= 0 && imagPart > 0 -> result || false
            realPart < 0 || imagPart < 0 -> result || true
            else -> result && false
        }
    }

    return result
}
/**
 * This exercise focuses on the intersection of "Representation of complex numbers in Python" and "Introduction to booleans".
 * Given a list of complex numbers, the function should perform complex boolean operations and return the result.
 *
 * @param complexNums A list of complex numbers represented as pairs of real and imaginary parts.
 * @return The boolean result of the complex operation.
 */
fun complexBooleanOperations(complexNums: List<Pair<Double, Double>>): Boolean {
/**
 * This exercise focuses on the intersection of "Representation of complex numbers in Python" and "Introduction to booleans".
 * Given a list of complex numbers, the function should perform complex boolean operations and return the result.
 *
 * @param complexNums A list of complex numbers represented as pairs of real and imaginary parts.
 * @return The boolean result of the complex operation.
 */
fun complexBooleanOperations(complexNums: List<Pair<Double, Double>>): Boolean {

    // Check if the list is empty
    if (complexNums.isEmpty()) {
        return false
    }

    // Perform complex boolean operations
    var result = true

    // Iterate through the list of complex numbers
    for (num in complexNums) {
        // Get the real and imaginary parts of the current complex number
        val (realPart, imagPart) = num

        // Perform complex boolean operations based on conditions
        result = when {
            realPart > 0 && imagPart <= 0 -> result && true
            realPart <= 0 && imagPart > 0 -> result || false
            realPart < 0 || imagPart < 0 -> result || true
            else -> result && false
        }
    }

    return result
}