/**
 * This function searches for the first occurrence of an element in a list of strings and returns the index of the first
 * non-matching element found after that occurrence. If the element is not found or there are no non-matching elements
 * after it, null is returned.
 *
 * @param items A list of strings containing elements to search.
 * @param element The element to search for in the list.
 * @return The index of the first non-matching element found after the occurrence of the specified element, or null if the
 * element is not found or there are no non-matching elements after it.
 */
fun findNonMatchingIndex(items: List<String>, element: String): Int? {

    try {
        var index = items.indexOf(element) + 1

        while (index < items.size) {
            if (items[index] != element) {
                return index
            }
            index++
        }

        return null
    } catch (e: NoSuchElementException) {
        return null
    }
}
/**
 * This function searches for the first occurrence of an element in a list of strings and returns the index of the first
 * non-matching element found after that occurrence. If the element is not found or there are no non-matching elements
 * after it, null is returned.
 *
 * @param items A list of strings containing elements to search.
 * @param element The element to search for in the list.
 * @return The index of the first non-matching element found after the occurrence of the specified element, or null if the
 * element is not found or there are no non-matching elements after it.
 */
fun findNonMatchingIndex(items: List<String>, element: String): Int? {
/**
 * This function searches for the first occurrence of an element in a list of strings and returns the index of the first
 * non-matching element found after that occurrence. If the element is not found or there are no non-matching elements
 * after it, null is returned.
 *
 * @param items A list of strings containing elements to search.
 * @param element The element to search for in the list.
 * @return The index of the first non-matching element found after the occurrence of the specified element, or null if the
 * element is not found or there are no non-matching elements after it.
 */
fun findNonMatchingIndex(items: List<String>, element: String): Int? {

    try {
        var index = items.indexOf(element) + 1

        while (index < items.size) {
            if (items[index] != element) {
                return index
            }
            index++
        }

        return null
    } catch (e: NoSuchElementException) {
        return null
    }
}