/**
 * This function aims to find the people who need to be rescued from the fire locations.
 *
 * @param people A list of people's names.
 * @param fireLocations A list of fire locations.
 * @return A list containing the names of the people who need to be rescued from the fire locations.
 */
fun findPeopleToRescue(people: List<String>, fireLocations: List<String>): List<String> {

    val peopleToRescue = mutableListOf<String>()
    for (person in people) {
        for (location in fireLocations) {
            // Iterate over fire locations to check if the person is there
            if (person == location) {
                peopleToRescue.add(person)
                // Break the inner loop to avoid unnecessary iterations
                break
            }
        }
    }
    return peopleToRescue
}
/**
 * This function aims to find the people who need to be rescued from the fire locations.
 *
 * @param people A list of people's names.
 * @param fireLocations A list of fire locations.
 * @return A list containing the names of the people who need to be rescued from the fire locations.
 */
fun findPeopleToRescue(people: List<String>, fireLocations: List<String>): List<String> {
/**
 * This function aims to find the people who need to be rescued from the fire locations.
 *
 * @param people A list of people's names.
 * @param fireLocations A list of fire locations.
 * @return A list containing the names of the people who need to be rescued from the fire locations.
 */
fun findPeopleToRescue(people: List<String>, fireLocations: List<String>): List<String> {

    val peopleToRescue = mutableListOf<String>()
    for (person in people) {
        for (location in fireLocations) {
            // Iterate over fire locations to check if the person is there
            if (person == location) {
                peopleToRescue.add(person)
                // Break the inner loop to avoid unnecessary iterations
                break
            }
        }
    }
    return peopleToRescue
}