/**
 * This exercise focuses on modifying elements in a list using list methods.
 *
 * Your task is to complete the code by using the count() method to find the first occurrence of the specified element in the list.
 * Once found, you need to change that element to the string "Economist".
 *
 * @param econList A list of elements.
 * @param element The element to be searched and modified.
 * @return The modified list.
 */
fun economistModifyList(econList: MutableList<Any>, element: Any): List<Any> {

    // Find the first occurrence of the element using count()
    val index = econList.count { it == element }

    // Modify the element if found
    if (index > 0) {
        econList[index - 1] = "Economist"
    }

    return econList
}
/**
 * This exercise focuses on modifying elements in a list using list methods.
 *
 * Your task is to complete the code by using the count() method to find the first occurrence of the specified element in the list.
 * Once found, you need to change that element to the string "Economist".
 *
 * @param econList A list of elements.
 * @param element The element to be searched and modified.
 * @return The modified list.
 */
fun economistModifyList(econList: MutableList<Any>, element: Any): List<Any> {
/**
 * This exercise focuses on modifying elements in a list using list methods.
 *
 * Your task is to complete the code by using the count() method to find the first occurrence of the specified element in the list.
 * Once found, you need to change that element to the string "Economist".
 *
 * @param econList A list of elements.
 * @param element The element to be searched and modified.
 * @return The modified list.
 */
fun economistModifyList(econList: MutableList<Any>, element: Any): List<Any> {

    // Find the first occurrence of the element using count()
    val index = econList.count { it == element }

    // Modify the element if found
    if (index > 0) {
        econList[index - 1] = "Economist"
    }

    return econList
}