/**
 * Given a street map, count the number of traffic signals present and return the count.
 *
 * @param streetMap A map representing a street map where the keys are street names and
 * the values are boolean values indicating the presence (true) or absence (false)
 * of a traffic signal.
 * @return The total count of traffic signals in the street map.
 *
 * Example:
 * val streetMap = mapOf("Street A" to true, "Street B" to false, "Street C" to true, "Street D" to true)
 * val count = countTrafficSignals(streetMap)
 * println(count)  // Output: 3
 *
 * Note:
 * - The input streetMap map can have both uppercase and lowercase street names.
 * - The streetMap may contain other keys apart from street names, but they can be safely ignored.
 */
fun countTrafficSignals(streetMap: Map<String, Boolean>): Int {

    var count = 0
    for ((streetName, hasTrafficSignal) in streetMap) {
        if (streetName.toLowerCase().startsWith("street") && hasTrafficSignal) {
            count++
        }
    }
    return count
}
/**
 * Given a street map, count the number of traffic signals present and return the count.
 *
 * @param streetMap A map representing a street map where the keys are street names and
 * the values are boolean values indicating the presence (true) or absence (false)
 * of a traffic signal.
 * @return The total count of traffic signals in the street map.
 *
 * Example:
 * val streetMap = mapOf("Street A" to true, "Street B" to false, "Street C" to true, "Street D" to true)
 * val count = countTrafficSignals(streetMap)
 * println(count)  // Output: 3
 *
 * Note:
 * - The input streetMap map can have both uppercase and lowercase street names.
 * - The streetMap may contain other keys apart from street names, but they can be safely ignored.
 */
fun countTrafficSignals(streetMap: Map<String, Boolean>): Int {
/**
 * Given a street map, count the number of traffic signals present and return the count.
 *
 * @param streetMap A map representing a street map where the keys are street names and
 * the values are boolean values indicating the presence (true) or absence (false)
 * of a traffic signal.
 * @return The total count of traffic signals in the street map.
 *
 * Example:
 * val streetMap = mapOf("Street A" to true, "Street B" to false, "Street C" to true, "Street D" to true)
 * val count = countTrafficSignals(streetMap)
 * println(count)  // Output: 3
 *
 * Note:
 * - The input streetMap map can have both uppercase and lowercase street names.
 * - The streetMap may contain other keys apart from street names, but they can be safely ignored.
 */
fun countTrafficSignals(streetMap: Map<String, Boolean>): Int {

    var count = 0
    for ((streetName, hasTrafficSignal) in streetMap) {
        if (streetName.toLowerCase().startsWith("street") && hasTrafficSignal) {
            count++
        }
    }
    return count
}