/**
 * Given a list of tuples, swap the second and third element of each tuple
 * and return the modified list.
 *
 * @param lst a list of tuples
 * @return the modified list with swapped elements
 */
fun swapElements(lst: List<Triple<Int, Int, Int>>): List<Triple<Int, Int, Int>> {

    val modifiedList = mutableListOf<Triple<Int, Int, Int>>()

    for (tpl in lst) {
        // Unpack the tuple into three variables
        val (a, b, c) = tpl

        // Swap the second and third element
        val modifiedTpl = Triple(a, c, b)

        // Append the modified tuple to the new list
        modifiedList.add(modifiedTpl)
    }

    return modifiedList
}
/**
 * Given a list of tuples, swap the second and third element of each tuple
 * and return the modified list.
 *
 * @param lst a list of tuples
 * @return the modified list with swapped elements
 */
fun swapElements(lst: List<Triple<Int, Int, Int>>): List<Triple<Int, Int, Int>> {
/**
 * Given a list of tuples, swap the second and third element of each tuple
 * and return the modified list.
 *
 * @param lst a list of tuples
 * @return the modified list with swapped elements
 */
fun swapElements(lst: List<Triple<Int, Int, Int>>): List<Triple<Int, Int, Int>> {

    val modifiedList = mutableListOf<Triple<Int, Int, Int>>()

    for (tpl in lst) {
        // Unpack the tuple into three variables
        val (a, b, c) = tpl

        // Swap the second and third element
        val modifiedTpl = Triple(a, c, b)

        // Append the modified tuple to the new list
        modifiedList.add(modifiedTpl)
    }

    return modifiedList
}