/**
 * Given two lists representing clothing items for a fashion designer, the function should return a new list
 * which contains only the elements that are common in both input lists.
 *
 * @param list1 A list of clothing items.
 * @param list2 Another list of clothing items.
 * @return A list with common elements between list1 and list2.
 *
 * Example:
 * accessCommonElements(listOf("shirt", "pants", "dress"), listOf("pants", "dress", "hat"))
 * >> Output: ['pants', 'dress']
 */
fun accessCommonElements(list1: List<String>, list2: List<String>): List<String> {

    val commonElements = mutableListOf<String>()

    for (item in list1) {
        if (item in list2) {
            commonElements.add(item)
        }
    }

    return commonElements
}
/**
 * Given two lists representing clothing items for a fashion designer, the function should return a new list
 * which contains only the elements that are common in both input lists.
 *
 * @param list1 A list of clothing items.
 * @param list2 Another list of clothing items.
 * @return A list with common elements between list1 and list2.
 *
 * Example:
 * accessCommonElements(listOf("shirt", "pants", "dress"), listOf("pants", "dress", "hat"))
 * >> Output: ['pants', 'dress']
 */
fun accessCommonElements(list1: List<String>, list2: List<String>): List<String> {
/**
 * Given two lists representing clothing items for a fashion designer, the function should return a new list
 * which contains only the elements that are common in both input lists.
 *
 * @param list1 A list of clothing items.
 * @param list2 Another list of clothing items.
 * @return A list with common elements between list1 and list2.
 *
 * Example:
 * accessCommonElements(listOf("shirt", "pants", "dress"), listOf("pants", "dress", "hat"))
 * >> Output: ['pants', 'dress']
 */
fun accessCommonElements(list1: List<String>, list2: List<String>): List<String> {

    val commonElements = mutableListOf<String>()

    for (item in list1) {
        if (item in list2) {
            commonElements.add(item)
        }
    }

    return commonElements
}