/**
 * Given a tuple and an element, append the element to the tuple and return the modified tuple.
 *
 * @param tuple1 The original tuple.
 * @param element The element to be added to the tuple.
 * @return The modified tuple after appending the element.
 *
 * Example:
 * appendToTuple(listOf(1, 2, 3), 4) // [1, 2, 3, 4]
 * appendToTuple(listOf('a', 'b', 'c'), 'd') // ['a', 'b', 'c', 'd']
 */
fun appendToTuple(tuple1: List<Any>, element: Any): List<Any> {

    val list1 = tuple1.toMutableList()
    list1.add(element)
    return list1
}
/**
 * Given a tuple and an element, append the element to the tuple and return the modified tuple.
 *
 * @param tuple1 The original tuple.
 * @param element The element to be added to the tuple.
 * @return The modified tuple after appending the element.
 *
 * Example:
 * appendToTuple(listOf(1, 2, 3), 4) // [1, 2, 3, 4]
 * appendToTuple(listOf('a', 'b', 'c'), 'd') // ['a', 'b', 'c', 'd']
 */
fun appendToTuple(tuple1: List<Any>, element: Any): List<Any> {
/**
 * Given a tuple and an element, append the element to the tuple and return the modified tuple.
 *
 * @param tuple1 The original tuple.
 * @param element The element to be added to the tuple.
 * @return The modified tuple after appending the element.
 *
 * Example:
 * appendToTuple(listOf(1, 2, 3), 4) // [1, 2, 3, 4]
 * appendToTuple(listOf('a', 'b', 'c'), 'd') // ['a', 'b', 'c', 'd']
 */
fun appendToTuple(tuple1: List<Any>, element: Any): List<Any> {

    val list1 = tuple1.toMutableList()
    list1.add(element)
    return list1
}