/**
 * Given two lists 'x' and 'y', find the intersection of both lists and return a new list
 * containing the common elements.
 *
 * @param x List<Int/Float/String> The first input list.
 * @param y List<Int/Float/String> The second input list.
 * @return List<Int/Float/String> A list containing the common elements of 'x' and 'y'.
 *
 * Example:
 * findIntersection(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) // [4, 5]
 * findIntersection(listOf("a", "b", "c"), listOf("b", "c", "d")) // ["b", "c"]
 */
fun findIntersection(x: List<Any>, y: List<Any>): List<Any> {

    // Use the 'intersect' function to find the intersection of the two lists
    val intersection = x.toSet().intersect(y.toSet()).toList()
    return intersection
}
/**
 * Given two lists 'x' and 'y', find the intersection of both lists and return a new list
 * containing the common elements.
 *
 * @param x List<Int/Float/String> The first input list.
 * @param y List<Int/Float/String> The second input list.
 * @return List<Int/Float/String> A list containing the common elements of 'x' and 'y'.
 *
 * Example:
 * findIntersection(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) // [4, 5]
 * findIntersection(listOf("a", "b", "c"), listOf("b", "c", "d")) // ["b", "c"]
 */
fun findIntersection(x: List<Any>, y: List<Any>): List<Any> {
/**
 * Given two lists 'x' and 'y', find the intersection of both lists and return a new list
 * containing the common elements.
 *
 * @param x List<Int/Float/String> The first input list.
 * @param y List<Int/Float/String> The second input list.
 * @return List<Int/Float/String> A list containing the common elements of 'x' and 'y'.
 *
 * Example:
 * findIntersection(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) // [4, 5]
 * findIntersection(listOf("a", "b", "c"), listOf("b", "c", "d")) // ["b", "c"]
 */
fun findIntersection(x: List<Any>, y: List<Any>): List<Any> {

    // Use the 'intersect' function to find the intersection of the two lists
    val intersection = x.toSet().intersect(y.toSet()).toList()
    return intersection
}