/**
 * Given a list of positive integers and a replacement integer, replace all even elements with the replacement value.
 *
 * Example:
 * replaceElements(listOf(2, 4, 6, 8, 10, 12), 0) should return [0, 4, 0, 8, 0, 12]
 */
fun replaceElements(numbers: List<Int>, replacement: Int): List<Int> {

    return numbers.map { if (it % 2 == 0) replacement else it }  // Replace even elements with the replacement value
}
/**
 * Given a list of positive integers and a replacement integer, replace all even elements with the replacement value.
 *
 * Example:
 * replaceElements(listOf(2, 4, 6, 8, 10, 12), 0) should return [0, 4, 0, 8, 0, 12]
 */
fun replaceElements(numbers: List<Int>, replacement: Int): List<Int> {
/**
 * Given a list of positive integers and a replacement integer, replace all even elements with the replacement value.
 *
 * Example:
 * replaceElements(listOf(2, 4, 6, 8, 10, 12), 0) should return [0, 4, 0, 8, 0, 12]
 */
fun replaceElements(numbers: List<Int>, replacement: Int): List<Int> {

    return numbers.map { if (it % 2 == 0) replacement else it }  // Replace even elements with the replacement value
}