/**
 * This function counts the number of occurrences of a given item in a nested list.
 *
 * @param nestedList A nested list containing various items.
 * @param item The item to count occurrences of.
 * @return The total number of occurrences of the item.
 */
fun countOccurrences(nestedList: List<List<Any>>, item: Any): Int {

    var count = 0

    for (sublist in nestedList) {
        var index = 0
        while (index < sublist.size) {
            if (sublist[index] == item) {
                count++
            }
            index++
        }
    }

    return count
}
/**
 * This function counts the number of occurrences of a given item in a nested list.
 *
 * @param nestedList A nested list containing various items.
 * @param item The item to count occurrences of.
 * @return The total number of occurrences of the item.
 */
fun countOccurrences(nestedList: List<List<Any>>, item: Any): Int {
/**
 * This function counts the number of occurrences of a given item in a nested list.
 *
 * @param nestedList A nested list containing various items.
 * @param item The item to count occurrences of.
 * @return The total number of occurrences of the item.
 */
fun countOccurrences(nestedList: List<List<Any>>, item: Any): Int {

    var count = 0

    for (sublist in nestedList) {
        var index = 0
        while (index < sublist.size) {
            if (sublist[index] == item) {
                count++
            }
            index++
        }
    }

    return count
}