/**
 * Given two complex numbers, return their sum.
 *
 * @param num1 A complex number represented as a Pair (real, imaginary).
 * @param num2 A complex number represented as a Pair (real, imaginary).
 * @return The sum of the two complex numbers as a Pair (real, imaginary).
 */
fun addComplexNumbers(num1: Pair<Double, Double>, num2: Pair<Double, Double>): Pair<Double, Double> {

    // Separate the real and imaginary parts of each number
    val (realPart1, imaginaryPart1) = num1
    val (realPart2, imaginaryPart2) = num2

    // Add the real parts and the imaginary parts separately
    val realSum = realPart1 + realPart2
    val imaginarySum = imaginaryPart1 + imaginaryPart2

    // Return the sum as a Pair (real, imaginary)
    return Pair(realSum, imaginarySum)
}
/**
 * Given two complex numbers, return their sum.
 *
 * @param num1 A complex number represented as a Pair (real, imaginary).
 * @param num2 A complex number represented as a Pair (real, imaginary).
 * @return The sum of the two complex numbers as a Pair (real, imaginary).
 */
fun addComplexNumbers(num1: Pair<Double, Double>, num2: Pair<Double, Double>): Pair<Double, Double> {
/**
 * Given two complex numbers, return their sum.
 *
 * @param num1 A complex number represented as a Pair (real, imaginary).
 * @param num2 A complex number represented as a Pair (real, imaginary).
 * @return The sum of the two complex numbers as a Pair (real, imaginary).
 */
fun addComplexNumbers(num1: Pair<Double, Double>, num2: Pair<Double, Double>): Pair<Double, Double> {

    // Separate the real and imaginary parts of each number
    val (realPart1, imaginaryPart1) = num1
    val (realPart2, imaginaryPart2) = num2

    // Add the real parts and the imaginary parts separately
    val realSum = realPart1 + realPart2
    val imaginarySum = imaginaryPart1 + imaginaryPart2

    // Return the sum as a Pair (real, imaginary)
    return Pair(realSum, imaginarySum)
}