/**
 * The task of this exercise is to find the faulty electrical outlets in a given room.
 * The function 'findFaultyOutlets' takes a map 'outlets' as input which represents the
 * electrical outlets in the room and their respective statuses. The keys of the map are the
 * outlet numbers (starting from 1) and the values are either 'working' or 'faulty'.
 *
 * Your task is to iterate through the 'outlets' map and find the outlet numbers of all the faulty outlets.
 * Finally, return a list containing the outlet numbers of the faulty outlets.
 *
 * Example:
 * val outlets = mapOf(1 to "working", 2 to "working", 3 to "faulty", 4 to "working", 5 to "faulty")
 *
 * Expected output:
 * listOf(3, 5)
 */
fun findFaultyOutlets(outlets: Map<Int, String>): List<Int> {

    val faultyOutlets = mutableListOf<Int>()
    try {
        for ((outletNumber, outletStatus) in outlets) {
            if (outletStatus == "faulty") {
                faultyOutlets.add(outletNumber)
            }
        }
        return faultyOutlets
    } catch (e: Exception) {
        return listOf(-1) // Return a default value or handle the exception accordingly
    }
}
/**
 * The task of this exercise is to find the faulty electrical outlets in a given room.
 * The function 'findFaultyOutlets' takes a map 'outlets' as input which represents the
 * electrical outlets in the room and their respective statuses. The keys of the map are the
 * outlet numbers (starting from 1) and the values are either 'working' or 'faulty'.
 *
 * Your task is to iterate through the 'outlets' map and find the outlet numbers of all the faulty outlets.
 * Finally, return a list containing the outlet numbers of the faulty outlets.
 *
 * Example:
 * val outlets = mapOf(1 to "working", 2 to "working", 3 to "faulty", 4 to "working", 5 to "faulty")
 *
 * Expected output:
 * listOf(3, 5)
 */
fun findFaultyOutlets(outlets: Map<Int, String>): List<Int> {
/**
 * The task of this exercise is to find the faulty electrical outlets in a given room.
 * The function 'findFaultyOutlets' takes a map 'outlets' as input which represents the
 * electrical outlets in the room and their respective statuses. The keys of the map are the
 * outlet numbers (starting from 1) and the values are either 'working' or 'faulty'.
 *
 * Your task is to iterate through the 'outlets' map and find the outlet numbers of all the faulty outlets.
 * Finally, return a list containing the outlet numbers of the faulty outlets.
 *
 * Example:
 * val outlets = mapOf(1 to "working", 2 to "working", 3 to "faulty", 4 to "working", 5 to "faulty")
 *
 * Expected output:
 * listOf(3, 5)
 */
fun findFaultyOutlets(outlets: Map<Int, String>): List<Int> {

    val faultyOutlets = mutableListOf<Int>()
    try {
        for ((outletNumber, outletStatus) in outlets) {
            if (outletStatus == "faulty") {
                faultyOutlets.add(outletNumber)
            }
        }
        return faultyOutlets
    } catch (e: Exception) {
        return listOf(-1) // Return a default value or handle the exception accordingly
    }
}