/**
 * As an Environmental Scientist, you have been given a list of temperature readings recorded at various locations.
 * Your task is to iterate over each temperature using a for loop, and check if it exceeds a given threshold.
 * If the temperature exceeds the threshold, store the location (index) in a tuple and return the tuple at the end.
 *
 * @param temperatureData A list of temperature readings.
 * @param threshold The maximum temperature threshold.
 * @return A tuple containing the indices (locations) of the temperatures that exceeded the threshold.
 */
fun checkTemperature(temperatureData: List<Double>, threshold: Double): List<Int> {

    val exceededIndices = mutableListOf<Int>()
    
    // Use a for loop to iterate over each temperature in the temperatureData
    for ((index, temperature) in temperatureData.withIndex()) {
        // Check if the temperature exceeds the threshold
        if (temperature > threshold) {
            // Store the index in the exceededIndices list
            exceededIndices.add(index)
        }
    }
    
    // Return the list containing the indices of the temperatures that exceeded the threshold
    return exceededIndices
}
/**
 * As an Environmental Scientist, you have been given a list of temperature readings recorded at various locations.
 * Your task is to iterate over each temperature using a for loop, and check if it exceeds a given threshold.
 * If the temperature exceeds the threshold, store the location (index) in a tuple and return the tuple at the end.
 *
 * @param temperatureData A list of temperature readings.
 * @param threshold The maximum temperature threshold.
 * @return A tuple containing the indices (locations) of the temperatures that exceeded the threshold.
 */
fun checkTemperature(temperatureData: List<Double>, threshold: Double): List<Int> {
/**
 * As an Environmental Scientist, you have been given a list of temperature readings recorded at various locations.
 * Your task is to iterate over each temperature using a for loop, and check if it exceeds a given threshold.
 * If the temperature exceeds the threshold, store the location (index) in a tuple and return the tuple at the end.
 *
 * @param temperatureData A list of temperature readings.
 * @param threshold The maximum temperature threshold.
 * @return A tuple containing the indices (locations) of the temperatures that exceeded the threshold.
 */
fun checkTemperature(temperatureData: List<Double>, threshold: Double): List<Int> {

    val exceededIndices = mutableListOf<Int>()
    
    // Use a for loop to iterate over each temperature in the temperatureData
    for ((index, temperature) in temperatureData.withIndex()) {
        // Check if the temperature exceeds the threshold
        if (temperature > threshold) {
            // Store the index in the exceededIndices list
            exceededIndices.add(index)
        }
    }
    
    // Return the list containing the indices of the temperatures that exceeded the threshold
    return exceededIndices
}