/**
 * This function takes two lists as input and returns a list of common elements between them.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A list of common elements between list1 and list2
 */
fun commonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val common = mutableListOf<Any>()  // Initialize an empty list to store the common elements

    // Iterate over each element in 'list1'
    // Using indices to access each element of the list
    for (element in list1) {
        // Check if the element is present in 'list2'
        // Using contains to check for presence of element in the list
        if (element in list2) {
            common.add(element)  // Add the common element to the 'common' list
        }
    }

    return common
}
/**
 * This function takes two lists as input and returns a list of common elements between them.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A list of common elements between list1 and list2
 */
fun commonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This function takes two lists as input and returns a list of common elements between them.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A list of common elements between list1 and list2
 */
fun commonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val common = mutableListOf<Any>()  // Initialize an empty list to store the common elements

    // Iterate over each element in 'list1'
    // Using indices to access each element of the list
    for (element in list1) {
        // Check if the element is present in 'list2'
        // Using contains to check for presence of element in the list
        if (element in list2) {
            common.add(element)  // Add the common element to the 'common' list
        }
    }

    return common
}