/**
 * In a burning building, a firefighter is trying to find common items
 * in two rooms by indexing tuples and creating a tuple using the tuple() function.
 *
 * Complete the function 'getCommonElements" that takes two lists as input,
 * and returns a new list containing the common elements from both lists.
 *
 * @param a First list containing elements.
 * @param b Second list containing elements.
 * @return A new list with common elements from both input lists.
 *
 * Example:
 * getCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) => listOf(3, 4)
 */
fun getCommonElements(a: List<Int>, b: List<Int>): List<Int> {

    // Convert the input lists to sets
    val setA = a.toSet()
    val setB = b.toSet()

    // Find the intersection of both sets
    val commonElements = setA.intersect(setB)

    // Create a new list from the common elements
    return commonElements.toList()
}
/**
 * In a burning building, a firefighter is trying to find common items
 * in two rooms by indexing tuples and creating a tuple using the tuple() function.
 *
 * Complete the function 'getCommonElements" that takes two lists as input,
 * and returns a new list containing the common elements from both lists.
 *
 * @param a First list containing elements.
 * @param b Second list containing elements.
 * @return A new list with common elements from both input lists.
 *
 * Example:
 * getCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) => listOf(3, 4)
 */
fun getCommonElements(a: List<Int>, b: List<Int>): List<Int> {
/**
 * In a burning building, a firefighter is trying to find common items
 * in two rooms by indexing tuples and creating a tuple using the tuple() function.
 *
 * Complete the function 'getCommonElements" that takes two lists as input,
 * and returns a new list containing the common elements from both lists.
 *
 * @param a First list containing elements.
 * @param b Second list containing elements.
 * @return A new list with common elements from both input lists.
 *
 * Example:
 * getCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) => listOf(3, 4)
 */
fun getCommonElements(a: List<Int>, b: List<Int>): List<Int> {

    // Convert the input lists to sets
    val setA = a.toSet()
    val setB = b.toSet()

    // Find the intersection of both sets
    val commonElements = setA.intersect(setB)

    // Create a new list from the common elements
    return commonElements.toList()
}