/**
 * Given two lists of integers, return a new list containing only the elements that are common to both lists.
 *
 * @param a The first list of integers.
 * @param b The second list of integers.
 * @return A new list containing the common elements found in both input lists.
 *
 * Example:
 * intersectionAndIdentityComparison(listOf(1, 2, 3, 4, 5), listOf(3, 4, 5, 6, 7)) // [3, 4, 5]
 * intersectionAndIdentityComparison(listOf(10, 20, 30, 40, 50), listOf(30, 40, 50, 60, 70)) // [30, 40, 50]
 */
fun intersectionAndIdentityComparison(a: List<Int>, b: List<Int>): List<Int> {

    return a.filter { it in b }
}
/**
 * Given two lists of integers, return a new list containing only the elements that are common to both lists.
 *
 * @param a The first list of integers.
 * @param b The second list of integers.
 * @return A new list containing the common elements found in both input lists.
 *
 * Example:
 * intersectionAndIdentityComparison(listOf(1, 2, 3, 4, 5), listOf(3, 4, 5, 6, 7)) // [3, 4, 5]
 * intersectionAndIdentityComparison(listOf(10, 20, 30, 40, 50), listOf(30, 40, 50, 60, 70)) // [30, 40, 50]
 */
fun intersectionAndIdentityComparison(a: List<Int>, b: List<Int>): List<Int> {
/**
 * Given two lists of integers, return a new list containing only the elements that are common to both lists.
 *
 * @param a The first list of integers.
 * @param b The second list of integers.
 * @return A new list containing the common elements found in both input lists.
 *
 * Example:
 * intersectionAndIdentityComparison(listOf(1, 2, 3, 4, 5), listOf(3, 4, 5, 6, 7)) // [3, 4, 5]
 * intersectionAndIdentityComparison(listOf(10, 20, 30, 40, 50), listOf(30, 40, 50, 60, 70)) // [30, 40, 50]
 */
fun intersectionAndIdentityComparison(a: List<Int>, b: List<Int>): List<Int> {

    return a.filter { it in b }
}