/**
 * Given the apparent power and the active power of multiple circuits,
 * this function determines the number of faulty circuits.
 *
 * @param apparentPower a list of apparent power values of circuits
 * @param activePower a list of active power values of circuits
 * @return The number of faulty circuits
 *
 * Note:
 * A circuit is considered faulty if its active power divided by its apparent power is not equal to zero.
 */
fun determineFaultyCircuits(apparentPower: List<Double>, activePower: List<Double>): Int {

    // Initialize the count of faulty circuits
    var faultyCount = 0

    // Iterate through all circuits
    for (i in apparentPower.indices) {
        // Calculate the active power divided by the apparent power and store it in the variable ratio
        var ratio = activePower[i] / apparentPower[i]

        // Check if the calculated ratio is not equal to zero
        if (ratio != 0.0) {
            // Increment the count of faulty circuits by 1
            faultyCount++
        }
    }

    // Return the total number of faulty circuits
    return faultyCount
}
/**
 * Given the apparent power and the active power of multiple circuits,
 * this function determines the number of faulty circuits.
 *
 * @param apparentPower a list of apparent power values of circuits
 * @param activePower a list of active power values of circuits
 * @return The number of faulty circuits
 *
 * Note:
 * A circuit is considered faulty if its active power divided by its apparent power is not equal to zero.
 */
fun determineFaultyCircuits(apparentPower: List<Double>, activePower: List<Double>): Int {
/**
 * Given the apparent power and the active power of multiple circuits,
 * this function determines the number of faulty circuits.
 *
 * @param apparentPower a list of apparent power values of circuits
 * @param activePower a list of active power values of circuits
 * @return The number of faulty circuits
 *
 * Note:
 * A circuit is considered faulty if its active power divided by its apparent power is not equal to zero.
 */
fun determineFaultyCircuits(apparentPower: List<Double>, activePower: List<Double>): Int {

    // Initialize the count of faulty circuits
    var faultyCount = 0

    // Iterate through all circuits
    for (i in apparentPower.indices) {
        // Calculate the active power divided by the apparent power and store it in the variable ratio
        var ratio = activePower[i] / apparentPower[i]

        // Check if the calculated ratio is not equal to zero
        if (ratio != 0.0) {
            // Increment the count of faulty circuits by 1
            faultyCount++
        }
    }

    // Return the total number of faulty circuits
    return faultyCount
}