/**
 * This exercise aims to test your knowledge of modulus and slicing in the context of electrical wires.
 *
 * Given a list of wires and a start index and end index, you need to return a list containing the wires that
 * have an index within the specified range (inclusive) and have a length that is divisible by 3.
 *
 * @param wires A list of electrical wires.
 * @param startIndex The start index of the range.
 * @param endIndex The end index of the range.
 * @return A new list of wires that meet the conditions.
 */
fun moduloSliceElectrical(wires: List<String>, startIndex: Int, endIndex: Int): List<String> {

    // Convert negative indices to positive indices
    var start = startIndex
    var end = endIndex
    if (start < 0) {
        start = wires.size + start
    }
    if (end < 0) {
        end = wires.size + end
    }

    // Perform modulus and slicing operations on the wires list
    val selectedWires = wires.subList(start, end + 1).filter { it.length % 3 == 0 }

    return selectedWires
}
/**
 * This exercise aims to test your knowledge of modulus and slicing in the context of electrical wires.
 *
 * Given a list of wires and a start index and end index, you need to return a list containing the wires that
 * have an index within the specified range (inclusive) and have a length that is divisible by 3.
 *
 * @param wires A list of electrical wires.
 * @param startIndex The start index of the range.
 * @param endIndex The end index of the range.
 * @return A new list of wires that meet the conditions.
 */
fun moduloSliceElectrical(wires: List<String>, startIndex: Int, endIndex: Int): List<String> {
/**
 * This exercise aims to test your knowledge of modulus and slicing in the context of electrical wires.
 *
 * Given a list of wires and a start index and end index, you need to return a list containing the wires that
 * have an index within the specified range (inclusive) and have a length that is divisible by 3.
 *
 * @param wires A list of electrical wires.
 * @param startIndex The start index of the range.
 * @param endIndex The end index of the range.
 * @return A new list of wires that meet the conditions.
 */
fun moduloSliceElectrical(wires: List<String>, startIndex: Int, endIndex: Int): List<String> {

    // Convert negative indices to positive indices
    var start = startIndex
    var end = endIndex
    if (start < 0) {
        start = wires.size + start
    }
    if (end < 0) {
        end = wires.size + end
    }

    // Perform modulus and slicing operations on the wires list
    val selectedWires = wires.subList(start, end + 1).filter { it.length % 3 == 0 }

    return selectedWires
}