/**
 * Given a list of animals in a farm inventory and the presence of a dog, a pig, and a cow,
 * this function removes the unwanted animals from the inventory using the AND operator.
 *
 * @param farmInventory A list of animals in the farm inventory.
 * @param dogPresent Represents if a dog is present in the farm.
 * @param pigPresent Represents if a pig is present in the farm.
 * @param cowPresent Represents if a cow is present in the farm.
 * @return The updated farm inventory after removing the unwanted animals.
 */
fun removeUnwantedAnimals(farmInventory: List<String>, dogPresent: Boolean, pigPresent: Boolean, cowPresent: Boolean): List<String> {

    var updatedInventory = farmInventory.toMutableList()

    if (dogPresent && pigPresent && cowPresent) {
        updatedInventory = updatedInventory.filter { it !in listOf("dog", "pig", "cow") }.toMutableList()
    }

    return updatedInventory
}
/**
 * Given a list of animals in a farm inventory and the presence of a dog, a pig, and a cow,
 * this function removes the unwanted animals from the inventory using the AND operator.
 *
 * @param farmInventory A list of animals in the farm inventory.
 * @param dogPresent Represents if a dog is present in the farm.
 * @param pigPresent Represents if a pig is present in the farm.
 * @param cowPresent Represents if a cow is present in the farm.
 * @return The updated farm inventory after removing the unwanted animals.
 */
fun removeUnwantedAnimals(farmInventory: List<String>, dogPresent: Boolean, pigPresent: Boolean, cowPresent: Boolean): List<String> {
/**
 * Given a list of animals in a farm inventory and the presence of a dog, a pig, and a cow,
 * this function removes the unwanted animals from the inventory using the AND operator.
 *
 * @param farmInventory A list of animals in the farm inventory.
 * @param dogPresent Represents if a dog is present in the farm.
 * @param pigPresent Represents if a pig is present in the farm.
 * @param cowPresent Represents if a cow is present in the farm.
 * @return The updated farm inventory after removing the unwanted animals.
 */
fun removeUnwantedAnimals(farmInventory: List<String>, dogPresent: Boolean, pigPresent: Boolean, cowPresent: Boolean): List<String> {

    var updatedInventory = farmInventory.toMutableList()

    if (dogPresent && pigPresent && cowPresent) {
        updatedInventory = updatedInventory.filter { it !in listOf("dog", "pig", "cow") }.toMutableList()
    }

    return updatedInventory
}