/**
 * A farmer wants to find the index of the blue tractor on his farm.
 * Each tractor is represented by a pair of color and type.
 * The farmer needs to iterate over the tractors and check if each tractor is blue.
 * If a blue tractor is found, return its index.
 * If no blue tractor is found, return -1.
 *
 * @param farm A list of pairs representing the tractors on the farm. Each pair consists of color and type.
 * @return The index of the blue tractor, or -1 if no blue tractor is found.
 *
 * Example:
 * findBlueTractor(listOf(Pair("red", "Bulldozer"), Pair("green", "Excavator"), Pair("blue", "Tractor")))
 * Output: 2
 */
fun findBlueTractor(farm: List<Pair<String, String>>): Int {

    for ((index, tractor) in farm.withIndex()) {
        if (tractor.first == "blue") {
            return index
        }
    }
    return -1
}
/**
 * A farmer wants to find the index of the blue tractor on his farm.
 * Each tractor is represented by a pair of color and type.
 * The farmer needs to iterate over the tractors and check if each tractor is blue.
 * If a blue tractor is found, return its index.
 * If no blue tractor is found, return -1.
 *
 * @param farm A list of pairs representing the tractors on the farm. Each pair consists of color and type.
 * @return The index of the blue tractor, or -1 if no blue tractor is found.
 *
 * Example:
 * findBlueTractor(listOf(Pair("red", "Bulldozer"), Pair("green", "Excavator"), Pair("blue", "Tractor")))
 * Output: 2
 */
fun findBlueTractor(farm: List<Pair<String, String>>): Int {
/**
 * A farmer wants to find the index of the blue tractor on his farm.
 * Each tractor is represented by a pair of color and type.
 * The farmer needs to iterate over the tractors and check if each tractor is blue.
 * If a blue tractor is found, return its index.
 * If no blue tractor is found, return -1.
 *
 * @param farm A list of pairs representing the tractors on the farm. Each pair consists of color and type.
 * @return The index of the blue tractor, or -1 if no blue tractor is found.
 *
 * Example:
 * findBlueTractor(listOf(Pair("red", "Bulldozer"), Pair("green", "Excavator"), Pair("blue", "Tractor")))
 * Output: 2
 */
fun findBlueTractor(farm: List<Pair<String, String>>): Int {

    for ((index, tractor) in farm.withIndex()) {
        if (tractor.first == "blue") {
            return index
        }
    }
    return -1
}