/**
 * This exercise aims to test your knowledge of list comprehension and the index() method.
 *
 * You are given a list of colors and a target_color. Your task is to write a function that finds the indexes of all occurrences of the target_color in the list using list comprehension and the index() method.
 *
 * @param colors A list containing various colors.
 * @param targetColor The color to search for.
 * @return A list containing the indexes of all occurrences of the target_color in the colors list.
 */
fun findSpecificColors(colors: List<String>, targetColor: String): List<Int> {

    // Initialize an empty list to store the indexes
    val indexes = mutableListOf<Int>()
    
    // Use list comprehension to iterate over the colors list and find the indexes of the target_color
    // using the index() method
    for ((index, color) in colors.withIndex()) {
        if (color == targetColor) {
            indexes.add(index)
        }
    }
    
    return indexes
}

// Colors list for testing
val colorsList = listOf("blue", "red", "green", "blue", "yellow", "blue")
/**
 * This exercise aims to test your knowledge of list comprehension and the index() method.
 *
 * You are given a list of colors and a target_color. Your task is to write a function that finds the indexes of all occurrences of the target_color in the list using list comprehension and the index() method.
 *
 * @param colors A list containing various colors.
 * @param targetColor The color to search for.
 * @return A list containing the indexes of all occurrences of the target_color in the colors list.
 */
fun findSpecificColors(colors: List<String>, targetColor: String): List<Int> {
/**
 * This exercise aims to test your knowledge of list comprehension and the index() method.
 *
 * You are given a list of colors and a target_color. Your task is to write a function that finds the indexes of all occurrences of the target_color in the list using list comprehension and the index() method.
 *
 * @param colors A list containing various colors.
 * @param targetColor The color to search for.
 * @return A list containing the indexes of all occurrences of the target_color in the colors list.
 */
fun findSpecificColors(colors: List<String>, targetColor: String): List<Int> {

    // Initialize an empty list to store the indexes
    val indexes = mutableListOf<Int>()
    
    // Use list comprehension to iterate over the colors list and find the indexes of the target_color
    // using the index() method
    for ((index, color) in colors.withIndex()) {
        if (color == targetColor) {
            indexes.add(index)
        }
    }
    
    return indexes
}

// Colors list for testing
val colorsList = listOf("blue", "red", "green", "blue", "yellow", "blue")