/**
 * This function takes in an original list and a condition, 
 * and returns a copy of the original list where each element is multiplied by 2 
 * if the condition is true, otherwise it remains the same.
 *
 * @param originalList The original list.
 * @param condition The condition to check for each element.
 * @return The copied list with modified elements based on the condition.
 *
 * Example:
 * val originalList = listOf(1, 2, 3, 4, 5)
 * val condition = true
 * copyListUsingTernaryOperator(originalList, condition) -> [2, 4, 6, 8, 10]
 */
fun copyListUsingTernaryOperator(originalList: List<Int>, condition: Boolean): List<Int> {

    // Apply ternary operator to copy the list and modify elements based on condition
    return originalList.map { if (condition) it * 2 else it }
}
/**
 * This function takes in an original list and a condition, 
 * and returns a copy of the original list where each element is multiplied by 2 
 * if the condition is true, otherwise it remains the same.
 *
 * @param originalList The original list.
 * @param condition The condition to check for each element.
 * @return The copied list with modified elements based on the condition.
 *
 * Example:
 * val originalList = listOf(1, 2, 3, 4, 5)
 * val condition = true
 * copyListUsingTernaryOperator(originalList, condition) -> [2, 4, 6, 8, 10]
 */
fun copyListUsingTernaryOperator(originalList: List<Int>, condition: Boolean): List<Int> {
/**
 * This function takes in an original list and a condition, 
 * and returns a copy of the original list where each element is multiplied by 2 
 * if the condition is true, otherwise it remains the same.
 *
 * @param originalList The original list.
 * @param condition The condition to check for each element.
 * @return The copied list with modified elements based on the condition.
 *
 * Example:
 * val originalList = listOf(1, 2, 3, 4, 5)
 * val condition = true
 * copyListUsingTernaryOperator(originalList, condition) -> [2, 4, 6, 8, 10]
 */
fun copyListUsingTernaryOperator(originalList: List<Int>, condition: Boolean): List<Int> {

    // Apply ternary operator to copy the list and modify elements based on condition
    return originalList.map { if (condition) it * 2 else it }
}