/**
 * Given two lists, concatenate them and return the resulting list.
 *
 * @param list1 the first list
 * @param list2 the second list
 * @return A new list containing elements from both input lists.
 *
 * Example:
 * concatenateLists(listOf(1, 2, 3), listOf(4, 5, 6)) -> [1, 2, 3, 4, 5, 6]
 * concatenateLists(listOf('a', 'b', 'c'), listOf('d', 'e', 'f')) -> ['a', 'b', 'c', 'd', 'e', 'f']
 */
fun concatenateLists(list1: List<Any>, list2: List<Any>): List<Any> {

    // Initialize an empty list to store the concatenated elements
    val concatenatedList = mutableListOf<Any>()

    // Iterate through elements in list1 and append them to the concatenatedList
    for (element in list1) {
        concatenatedList.add(element)
    }

    // Iterate through elements in list2 and append them to the concatenatedList
    for (element in list2) {
        concatenatedList.add(element)
    }

    // Return the final concatenatedList
    return concatenatedList
}
/**
 * Given two lists, concatenate them and return the resulting list.
 *
 * @param list1 the first list
 * @param list2 the second list
 * @return A new list containing elements from both input lists.
 *
 * Example:
 * concatenateLists(listOf(1, 2, 3), listOf(4, 5, 6)) -> [1, 2, 3, 4, 5, 6]
 * concatenateLists(listOf('a', 'b', 'c'), listOf('d', 'e', 'f')) -> ['a', 'b', 'c', 'd', 'e', 'f']
 */
fun concatenateLists(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Given two lists, concatenate them and return the resulting list.
 *
 * @param list1 the first list
 * @param list2 the second list
 * @return A new list containing elements from both input lists.
 *
 * Example:
 * concatenateLists(listOf(1, 2, 3), listOf(4, 5, 6)) -> [1, 2, 3, 4, 5, 6]
 * concatenateLists(listOf('a', 'b', 'c'), listOf('d', 'e', 'f')) -> ['a', 'b', 'c', 'd', 'e', 'f']
 */
fun concatenateLists(list1: List<Any>, list2: List<Any>): List<Any> {

    // Initialize an empty list to store the concatenated elements
    val concatenatedList = mutableListOf<Any>()

    // Iterate through elements in list1 and append them to the concatenatedList
    for (element in list1) {
        concatenatedList.add(element)
    }

    // Iterate through elements in list2 and append them to the concatenatedList
    for (element in list2) {
        concatenatedList.add(element)
    }

    // Return the final concatenatedList
    return concatenatedList
}