/**
 * Given a list of components and a value, count the number of resistors with the given value.
 *
 * @param components a list of components
 * @param value the value of resistors to be counted
 * @return the number of resistors with the given value
 */
fun countResistors(components: List<String>, value: String): Int {

    var count = 0
    for (component in components) {
        if (component.contains("resistor", ignoreCase = true)) {
            val componentValue = component.split(" ").last()
            if (componentValue == value) {
                count++
            }
        }
    }
    return count
}
/**
 * Given a list of components and a value, count the number of resistors with the given value.
 *
 * @param components a list of components
 * @param value the value of resistors to be counted
 * @return the number of resistors with the given value
 */
fun countResistors(components: List<String>, value: String): Int {
/**
 * Given a list of components and a value, count the number of resistors with the given value.
 *
 * @param components a list of components
 * @param value the value of resistors to be counted
 * @return the number of resistors with the given value
 */
fun countResistors(components: List<String>, value: String): Int {

    var count = 0
    for (component in components) {
        if (component.contains("resistor", ignoreCase = true)) {
            val componentValue = component.split(" ").last()
            if (componentValue == value) {
                count++
            }
        }
    }
    return count
}