/**
 * This exercise focuses on appending elements to a list and understanding the precedence of logical operators.
 *
 * @param elements a list of elements
 * @param condition1 a boolean condition
 * @param condition2 a boolean condition
 * @return The updated list after appending the elements that satisfy both conditions (condition1 and condition2).
 */
fun appendAndCheck(elements: List<Any>, condition1: Boolean, condition2: Boolean): List<Any> {

    // Initialize an empty list to store the result
    val result = mutableListOf<Any>()
    
    // Iterate over the elements
    for (element in elements) {
        // Check if both conditions are true (using '&&' operator)
        if (condition1 && condition2) {
            // Append the element to the result list
            result.add(element)
        }
    }
    
    // Return the updated list
    return result
}
/**
 * This exercise focuses on appending elements to a list and understanding the precedence of logical operators.
 *
 * @param elements a list of elements
 * @param condition1 a boolean condition
 * @param condition2 a boolean condition
 * @return The updated list after appending the elements that satisfy both conditions (condition1 and condition2).
 */
fun appendAndCheck(elements: List<Any>, condition1: Boolean, condition2: Boolean): List<Any> {
/**
 * This exercise focuses on appending elements to a list and understanding the precedence of logical operators.
 *
 * @param elements a list of elements
 * @param condition1 a boolean condition
 * @param condition2 a boolean condition
 * @return The updated list after appending the elements that satisfy both conditions (condition1 and condition2).
 */
fun appendAndCheck(elements: List<Any>, condition1: Boolean, condition2: Boolean): List<Any> {

    // Initialize an empty list to store the result
    val result = mutableListOf<Any>()
    
    // Iterate over the elements
    for (element in elements) {
        // Check if both conditions are true (using '&&' operator)
        if (condition1 && condition2) {
            // Append the element to the result list
            result.add(element)
        }
    }
    
    // Return the updated list
    return result
}