/**
 * As a farmer, you have successfully cultivated different crops on your field. The farmerProduce parameter is a list
 * representing the different crops and their respective quantities grown. Your goal is to access the quantity of a specific
 * crop in the list and return it.
 *
 * @param farmerProduce A list containing the crops and their respective quantities grown by the farmer.
 * @return The quantity of the specified crop.
 *
 * Example:
 * harvestCrops(listOf("corn" to 50, "wheat" to 30, "tomato" to 100))
 *
 * Given the above list, you need to return the quantity of 'corn', which is 50.
 */
fun harvestCrops(farmerProduce: List<Pair<String, Int>>): Int {

    // List of crops
    val crops = listOf("corn", "wheat", "tomato")
    // List of respective quantities
    val quantities = listOf(50, 30, 100)

    // Accessing elements in the list using indexing of tuples and lists
    val cornQuantity = quantities[crops.indexOfFirst { it == "corn" }]

    return cornQuantity
}
/**
 * As a farmer, you have successfully cultivated different crops on your field. The farmerProduce parameter is a list
 * representing the different crops and their respective quantities grown. Your goal is to access the quantity of a specific
 * crop in the list and return it.
 *
 * @param farmerProduce A list containing the crops and their respective quantities grown by the farmer.
 * @return The quantity of the specified crop.
 *
 * Example:
 * harvestCrops(listOf("corn" to 50, "wheat" to 30, "tomato" to 100))
 *
 * Given the above list, you need to return the quantity of 'corn', which is 50.
 */
fun harvestCrops(farmerProduce: List<Pair<String, Int>>): Int {
/**
 * As a farmer, you have successfully cultivated different crops on your field. The farmerProduce parameter is a list
 * representing the different crops and their respective quantities grown. Your goal is to access the quantity of a specific
 * crop in the list and return it.
 *
 * @param farmerProduce A list containing the crops and their respective quantities grown by the farmer.
 * @return The quantity of the specified crop.
 *
 * Example:
 * harvestCrops(listOf("corn" to 50, "wheat" to 30, "tomato" to 100))
 *
 * Given the above list, you need to return the quantity of 'corn', which is 50.
 */
fun harvestCrops(farmerProduce: List<Pair<String, Int>>): Int {

    // List of crops
    val crops = listOf("corn", "wheat", "tomato")
    // List of respective quantities
    val quantities = listOf(50, 30, 100)

    // Accessing elements in the list using indexing of tuples and lists
    val cornQuantity = quantities[crops.indexOfFirst { it == "corn" }]

    return cornQuantity
}