/**
 * This function takes a list of wire data and returns the indices of faulty wires.
 *
 * @param wireData A list of wire data, where each element is a string.
 * @return A list of indices indicating the faulty wires.
 */
fun findFaultyWires(wireData: List<String>): List<Int> {

    // Create an empty list to store the indices of faulty wires
    val faultyWires = mutableListOf<Int>()

    // Iterate over each wire in the wireData list
    for ((index, wire) in wireData.withIndex()) {
        // Check if the wire has a fault
        if (wire.substring(0, 3) == "FAU") {
            // Check if the wire has a fault at the end
            if (wire.substring(wire.length - 3) == "END") {
                // Check if the wire has a fault in the middle
                if (wire.substring(3, wire.length - 3) == "LTY") {
                    // Add the index of the faulty wire to the list
                    faultyWires.add(index)
                }
            }
        }
    }

    // Return the list of indices of faulty wires
    return faultyWires
}
/**
 * This function takes a list of wire data and returns the indices of faulty wires.
 *
 * @param wireData A list of wire data, where each element is a string.
 * @return A list of indices indicating the faulty wires.
 */
fun findFaultyWires(wireData: List<String>): List<Int> {
/**
 * This function takes a list of wire data and returns the indices of faulty wires.
 *
 * @param wireData A list of wire data, where each element is a string.
 * @return A list of indices indicating the faulty wires.
 */
fun findFaultyWires(wireData: List<String>): List<Int> {

    // Create an empty list to store the indices of faulty wires
    val faultyWires = mutableListOf<Int>()

    // Iterate over each wire in the wireData list
    for ((index, wire) in wireData.withIndex()) {
        // Check if the wire has a fault
        if (wire.substring(0, 3) == "FAU") {
            // Check if the wire has a fault at the end
            if (wire.substring(wire.length - 3) == "END") {
                // Check if the wire has a fault in the middle
                if (wire.substring(3, wire.length - 3) == "LTY") {
                    // Add the index of the faulty wire to the list
                    faultyWires.add(index)
                }
            }
        }
    }

    // Return the list of indices of faulty wires
    return faultyWires
}