/**
 * As a biologist, you have two lists: list1 and list2, containing different elements.
 * Your task is to find the common elements present in both lists using the '!=' operator.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return List containing the common elements present in both lists.
 */
fun getCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Loop through each element in list1
    for (element1 in list1) {
        // Loop through each element in list2
        for (element2 in list2) {
            // Check if the elements are the same using '!=' operator
            if (element1 != element2) {
                // Check if the element is not already present in commonElements list
                if (element1 !in commonElements) {
                    commonElements.add(element1)
                }
            }
        }
    }

    return commonElements
}
/**
 * As a biologist, you have two lists: list1 and list2, containing different elements.
 * Your task is to find the common elements present in both lists using the '!=' operator.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return List containing the common elements present in both lists.
 */
fun getCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * As a biologist, you have two lists: list1 and list2, containing different elements.
 * Your task is to find the common elements present in both lists using the '!=' operator.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return List containing the common elements present in both lists.
 */
fun getCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Loop through each element in list1
    for (element1 in list1) {
        // Loop through each element in list2
        for (element2 in list2) {
            // Check if the elements are the same using '!=' operator
            if (element1 != element2) {
                // Check if the element is not already present in commonElements list
                if (element1 !in commonElements) {
                    commonElements.add(element1)
                }
            }
        }
    }

    return commonElements
}