/**
 * The exercise is about finding the quotes spoken by specific individuals and returning them as a list.
 *
 * @param people A list of journalists' names.
 * @param quotes A map mapping journalists to their quotes.
 * @return A list containing quotes spoken by the specified journalists.
 *
 * Instructions:
 * - Loop through each journalist name in the given list.
 * - Check if the journalist exists as a key in the quotes map.
 * - If the journalist exists, retrieve their quote(s) and add them to a temporary list.
 * - After iterating through all the given journalists, convert the temporary list to a list.
 * - Lastly, return the list of quotes spoken by the specified journalists.
 *
 * Note:
 * - Make sure to handle the case where a journalist does not have any quotes in the map.
 * - The quotes map has journalists as keys and their quotes as values.
 */
fun findingQuotes(people: List<String>, quotes: Map<String, List<String>>): List<String> {

    val journalistQuotes = mutableListOf<String>()  // Temporary list to store quotes

    for (journalist in people) {
        if (quotes.containsKey(journalist)) {
            journalistQuotes.addAll(quotes[journalist]!!)
        }
    }

    return journalistQuotes
}
/**
 * The exercise is about finding the quotes spoken by specific individuals and returning them as a list.
 *
 * @param people A list of journalists' names.
 * @param quotes A map mapping journalists to their quotes.
 * @return A list containing quotes spoken by the specified journalists.
 *
 * Instructions:
 * - Loop through each journalist name in the given list.
 * - Check if the journalist exists as a key in the quotes map.
 * - If the journalist exists, retrieve their quote(s) and add them to a temporary list.
 * - After iterating through all the given journalists, convert the temporary list to a list.
 * - Lastly, return the list of quotes spoken by the specified journalists.
 *
 * Note:
 * - Make sure to handle the case where a journalist does not have any quotes in the map.
 * - The quotes map has journalists as keys and their quotes as values.
 */
fun findingQuotes(people: List<String>, quotes: Map<String, List<String>>): List<String> {
/**
 * The exercise is about finding the quotes spoken by specific individuals and returning them as a list.
 *
 * @param people A list of journalists' names.
 * @param quotes A map mapping journalists to their quotes.
 * @return A list containing quotes spoken by the specified journalists.
 *
 * Instructions:
 * - Loop through each journalist name in the given list.
 * - Check if the journalist exists as a key in the quotes map.
 * - If the journalist exists, retrieve their quote(s) and add them to a temporary list.
 * - After iterating through all the given journalists, convert the temporary list to a list.
 * - Lastly, return the list of quotes spoken by the specified journalists.
 *
 * Note:
 * - Make sure to handle the case where a journalist does not have any quotes in the map.
 * - The quotes map has journalists as keys and their quotes as values.
 */
fun findingQuotes(people: List<String>, quotes: Map<String, List<String>>): List<String> {

    val journalistQuotes = mutableListOf<String>()  // Temporary list to store quotes

    for (journalist in people) {
        if (quotes.containsKey(journalist)) {
            journalistQuotes.addAll(quotes[journalist]!!)
        }
    }

    return journalistQuotes
}