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

    val common = list1.filter { it in list2 }  // Filter to find common elements

    return if (common.isNotEmpty()) common else listOf("No common elements found")  // Returns the common elements or a message if none found
}
/**
 * This function takes two lists as input and returns a new list containing
 * the common elements between the two lists using list filtering.
 *
 * @param list1 The first input list.
 * @param list2 The second input list.
 * @return A new list containing the 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 new list containing
 * the common elements between the two lists using list filtering.
 *
 * @param list1 The first input list.
 * @param list2 The second input list.
 * @return A new list containing the common elements between list1 and list2.
 */
fun commonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val common = list1.filter { it in list2 }  // Filter to find common elements

    return if (common.isNotEmpty()) common else listOf("No common elements found")  // Returns the common elements or a message if none found
}