/**
 * Given two lists, return a new list that contains the elements present in the first list but not in the second list.
 *
 * @param list1 a list of elements
 * @param list2 a list of elements
 * @return result a list of elements
 */
fun subtractLists(list1: List<Any>, list2: List<Any>): List<Any> {

    // Return an empty list if either of the input lists is empty
    if (list1.isEmpty() || list2.isEmpty()) {
        return emptyList()
    }

    // Create a mutable list to store the result
    val result = list1.toMutableList()

    // Iterate over the elements in the second list
    for (element in list2) {
        // Check if the element exists in the first list
        if (element in result) {
            // Remove the element from the list if it is found
            result.remove(element)
        }
    }

    return result
}
/**
 * Given two lists, return a new list that contains the elements present in the first list but not in the second list.
 *
 * @param list1 a list of elements
 * @param list2 a list of elements
 * @return result a list of elements
 */
fun subtractLists(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Given two lists, return a new list that contains the elements present in the first list but not in the second list.
 *
 * @param list1 a list of elements
 * @param list2 a list of elements
 * @return result a list of elements
 */
fun subtractLists(list1: List<Any>, list2: List<Any>): List<Any> {

    // Return an empty list if either of the input lists is empty
    if (list1.isEmpty() || list2.isEmpty()) {
        return emptyList()
    }

    // Create a mutable list to store the result
    val result = list1.toMutableList()

    // Iterate over the elements in the second list
    for (element in list2) {
        // Check if the element exists in the first list
        if (element in result) {
            // Remove the element from the list if it is found
            result.remove(element)
        }
    }

    return result
}