/**
 * This function takes a sequence of numbers and a condition as input.
 * It replaces any number in the sequence that satisfies the condition with -1.
 * You need to write the code completing the function using an alternative to ternary operator
 * and iterating over the given sequence.
 *
 * @param sequence A sequence of numbers (list or tuple)
 * @param condition A condition that takes a number and returns a boolean value
 * @return A new sequence with the numbers that satisfy the condition replaced by -1.
 */
fun alternativeSequence(sequence: List<Int>, condition: (Int) -> Boolean): List<Int> {

    // This solution uses map and the alternative to ternary operator
    return sequence.map { if (condition(it)) -1 else it }
}
/**
 * This function takes a sequence of numbers and a condition as input.
 * It replaces any number in the sequence that satisfies the condition with -1.
 * You need to write the code completing the function using an alternative to ternary operator
 * and iterating over the given sequence.
 *
 * @param sequence A sequence of numbers (list or tuple)
 * @param condition A condition that takes a number and returns a boolean value
 * @return A new sequence with the numbers that satisfy the condition replaced by -1.
 */
fun alternativeSequence(sequence: List<Int>, condition: (Int) -> Boolean): List<Int> {
/**
 * This function takes a sequence of numbers and a condition as input.
 * It replaces any number in the sequence that satisfies the condition with -1.
 * You need to write the code completing the function using an alternative to ternary operator
 * and iterating over the given sequence.
 *
 * @param sequence A sequence of numbers (list or tuple)
 * @param condition A condition that takes a number and returns a boolean value
 * @return A new sequence with the numbers that satisfy the condition replaced by -1.
 */
fun alternativeSequence(sequence: List<Int>, condition: (Int) -> Boolean): List<Int> {

    // This solution uses map and the alternative to ternary operator
    return sequence.map { if (condition(it)) -1 else it }
}