/**
 * This function takes in two lists: 'animals' and 'weights'.
 * It calculates the total weight of all the animals and returns it.
 *
 * Complete the code by using the 'break' statement and the multiplication assignment operator '*='.
 */
fun calculateTotalWeight(animals: List<String>, weights: List<Int>): Int {

    var totalWeight = 0

    for ((index, animal) in animals.withIndex()) {
        if (animal == "elephant") {
            // Break the loop if the animal is an elephant
            break
        }
        // Multiply the weight with totalWeight using the multiplication assignment operator
        totalWeight *= weights[index]
    }

    return totalWeight
}
/**
 * This function takes in two lists: 'animals' and 'weights'.
 * It calculates the total weight of all the animals and returns it.
 *
 * Complete the code by using the 'break' statement and the multiplication assignment operator '*='.
 */
fun calculateTotalWeight(animals: List<String>, weights: List<Int>): Int {
/**
 * This function takes in two lists: 'animals' and 'weights'.
 * It calculates the total weight of all the animals and returns it.
 *
 * Complete the code by using the 'break' statement and the multiplication assignment operator '*='.
 */
fun calculateTotalWeight(animals: List<String>, weights: List<Int>): Int {

    var totalWeight = 0

    for ((index, animal) in animals.withIndex()) {
        if (animal == "elephant") {
            // Break the loop if the animal is an elephant
            break
        }
        // Multiply the weight with totalWeight using the multiplication assignment operator
        totalWeight *= weights[index]
    }

    return totalWeight
}