/**
 * Given a list of tuples containing two elements each, swap the elements in each tuple using list comprehensions.
 *
 * @param tupleList List of tuples containing two elements each.
 * @return List with the elements in each tuple swapped.
 *
 * Example:
 * swapElements(listOf(1 to 2, 3 to 4, 5 to 6)) => [(2, 1), (4, 3), (6, 5)]
 */
fun swapElements(tupleList: List<Pair<Int, Int>>): List<Pair<Int, Int>> {

    return tupleList.map { it.second to it.first }
}
/**
 * Given a list of tuples containing two elements each, swap the elements in each tuple using list comprehensions.
 *
 * @param tupleList List of tuples containing two elements each.
 * @return List with the elements in each tuple swapped.
 *
 * Example:
 * swapElements(listOf(1 to 2, 3 to 4, 5 to 6)) => [(2, 1), (4, 3), (6, 5)]
 */
fun swapElements(tupleList: List<Pair<Int, Int>>): List<Pair<Int, Int>> {
/**
 * Given a list of tuples containing two elements each, swap the elements in each tuple using list comprehensions.
 *
 * @param tupleList List of tuples containing two elements each.
 * @return List with the elements in each tuple swapped.
 *
 * Example:
 * swapElements(listOf(1 to 2, 3 to 4, 5 to 6)) => [(2, 1), (4, 3), (6, 5)]
 */
fun swapElements(tupleList: List<Pair<Int, Int>>): List<Pair<Int, Int>> {

    return tupleList.map { it.second to it.first }
}