/**
 * Given a tuple of four integers, find the sum of the two smallest numbers in the tuple.
 *
 * @param numbers A tuple of four integers.
 * @return A tuple containing the two smallest numbers in the input tuple.
 *
 * Example:
 * findSum(listOf(5, 1, 9, 3)) // (1, 3)
 * findSum(listOf(10, 20, 30, 40)) // (10, 20)
 */
fun findSum(numbers: List<Int>): Pair<Int, Int> {

    var smallest = Int.MAX_VALUE
    var secondSmallest = Int.MAX_VALUE

    for (num in numbers) {
        if (num < smallest) {
            secondSmallest = smallest
            smallest = num
        } else if (num < secondSmallest) {
            secondSmallest = num
        }
    }

    return Pair(smallest, secondSmallest)
}
/**
 * Given a tuple of four integers, find the sum of the two smallest numbers in the tuple.
 *
 * @param numbers A tuple of four integers.
 * @return A tuple containing the two smallest numbers in the input tuple.
 *
 * Example:
 * findSum(listOf(5, 1, 9, 3)) // (1, 3)
 * findSum(listOf(10, 20, 30, 40)) // (10, 20)
 */
fun findSum(numbers: List<Int>): Pair<Int, Int> {
/**
 * Given a tuple of four integers, find the sum of the two smallest numbers in the tuple.
 *
 * @param numbers A tuple of four integers.
 * @return A tuple containing the two smallest numbers in the input tuple.
 *
 * Example:
 * findSum(listOf(5, 1, 9, 3)) // (1, 3)
 * findSum(listOf(10, 20, 30, 40)) // (10, 20)
 */
fun findSum(numbers: List<Int>): Pair<Int, Int> {

    var smallest = Int.MAX_VALUE
    var secondSmallest = Int.MAX_VALUE

    for (num in numbers) {
        if (num < smallest) {
            secondSmallest = smallest
            smallest = num
        } else if (num < secondSmallest) {
            secondSmallest = num
        }
    }

    return Pair(smallest, secondSmallest)
}