/**
 * This exercise requires finding the sockets with missing grounding in a given wiring setup.
 *
 * @param socketsSet A set of all the sockets available in the building.
 * @param wiringString A string representing the wiring setup, where 'G' denotes grounding, 'N' denotes neutral,
 *                     and 'H' denotes hot wire.
 * @return A set of sockets that have missing grounding.
 */
fun findSocketsWithMissingGrounding(socketsSet: Set<String>, wiringString: String): Set<String> {

    val missingGroundingSockets = mutableSetOf<String>()

    for (socket in socketsSet) {
        var hasGrounding = false
        for (char in wiringString) {
            if (char == 'G' && socket in char.toString()) {
                hasGrounding = true
                break
            }
        }
        if (!hasGrounding) {
            missingGroundingSockets.add(socket)
        }
    }

    return missingGroundingSockets
}
/**
 * This exercise requires finding the sockets with missing grounding in a given wiring setup.
 *
 * @param socketsSet A set of all the sockets available in the building.
 * @param wiringString A string representing the wiring setup, where 'G' denotes grounding, 'N' denotes neutral,
 *                     and 'H' denotes hot wire.
 * @return A set of sockets that have missing grounding.
 */
fun findSocketsWithMissingGrounding(socketsSet: Set<String>, wiringString: String): Set<String> {
/**
 * This exercise requires finding the sockets with missing grounding in a given wiring setup.
 *
 * @param socketsSet A set of all the sockets available in the building.
 * @param wiringString A string representing the wiring setup, where 'G' denotes grounding, 'N' denotes neutral,
 *                     and 'H' denotes hot wire.
 * @return A set of sockets that have missing grounding.
 */
fun findSocketsWithMissingGrounding(socketsSet: Set<String>, wiringString: String): Set<String> {

    val missingGroundingSockets = mutableSetOf<String>()

    for (socket in socketsSet) {
        var hasGrounding = false
        for (char in wiringString) {
            if (char == 'G' && socket in char.toString()) {
                hasGrounding = true
                break
            }
        }
        if (!hasGrounding) {
            missingGroundingSockets.add(socket)
        }
    }

    return missingGroundingSockets
}