/**
 * Given a list of numbers, find all possible combinations of pairs that sum up to a target number.
 *
 * @param numbers A list of integers.
 * @param targetNumber The target number to find pairs that sum up to.
 * @return A list of pairs containing numbers that sum up to the target number.
 *
 * Example:
 * findCombinations(listOf(1, 2, 3, 4, 5), 7)
 * Output: [(2, 5), (3, 4)]
 */
fun findCombinations(numbers: List<Int>, targetNumber: Int): List<Pair<Int, Int>> {

    val combinations = mutableListOf<Pair<Int, Int>>()

    // Check all possible pairs of numbers
    for (i in numbers.indices) {
        for (j in i + 1 until numbers.size) {
            if (numbers[i] + numbers[j] == targetNumber) {
                combinations.add(Pair(numbers[i], numbers[j]))
            }
        }
    }

    return combinations
}
/**
 * Given a list of numbers, find all possible combinations of pairs that sum up to a target number.
 *
 * @param numbers A list of integers.
 * @param targetNumber The target number to find pairs that sum up to.
 * @return A list of pairs containing numbers that sum up to the target number.
 *
 * Example:
 * findCombinations(listOf(1, 2, 3, 4, 5), 7)
 * Output: [(2, 5), (3, 4)]
 */
fun findCombinations(numbers: List<Int>, targetNumber: Int): List<Pair<Int, Int>> {
/**
 * Given a list of numbers, find all possible combinations of pairs that sum up to a target number.
 *
 * @param numbers A list of integers.
 * @param targetNumber The target number to find pairs that sum up to.
 * @return A list of pairs containing numbers that sum up to the target number.
 *
 * Example:
 * findCombinations(listOf(1, 2, 3, 4, 5), 7)
 * Output: [(2, 5), (3, 4)]
 */
fun findCombinations(numbers: List<Int>, targetNumber: Int): List<Pair<Int, Int>> {

    val combinations = mutableListOf<Pair<Int, Int>>()

    // Check all possible pairs of numbers
    for (i in numbers.indices) {
        for (j in i + 1 until numbers.size) {
            if (numbers[i] + numbers[j] == targetNumber) {
                combinations.add(Pair(numbers[i], numbers[j]))
            }
        }
    }

    return combinations
}