/**
 * Given a list of complex numbers in polar representation, this function calculates the number of repetitions
 * present and returns a string indicating the result. A repetition occurs when two or more complex numbers in the list
 * have the same magnitude and the same angle.
 *
 * @param polarNumbers A list of complex numbers in polar representation [magnitude, angle].
 * @return A string indicating the number of repetitions found or "No repetitions" if none are found.
 */
fun calculateRepetitions(polarNumbers: List<Pair<Double, Double>>): String {

    var repetitions = 0

    // Check each pair of complex numbers for repetitions
    for (i in polarNumbers.indices) {
        for (j in i + 1 until polarNumbers.size) {
            if (polarNumbers[i].first == polarNumbers[j].first && polarNumbers[i].second == polarNumbers[j].second) {
                repetitions++
            }
        }
    }

    return if (repetitions == 0) {
        "No repetitions"
    } else {
        "Repetitions found: $repetitions"
    }
}

// Sample Test Case
val polarInput = listOf(
    Pair(3.0, 0.0),
    Pair(2.0, 1.2),
    Pair(3.0, 1.2)
)
/**
 * Given a list of complex numbers in polar representation, this function calculates the number of repetitions
 * present and returns a string indicating the result. A repetition occurs when two or more complex numbers in the list
 * have the same magnitude and the same angle.
 *
 * @param polarNumbers A list of complex numbers in polar representation [magnitude, angle].
 * @return A string indicating the number of repetitions found or "No repetitions" if none are found.
 */
fun calculateRepetitions(polarNumbers: List<Pair<Double, Double>>): String {
/**
 * Given a list of complex numbers in polar representation, this function calculates the number of repetitions
 * present and returns a string indicating the result. A repetition occurs when two or more complex numbers in the list
 * have the same magnitude and the same angle.
 *
 * @param polarNumbers A list of complex numbers in polar representation [magnitude, angle].
 * @return A string indicating the number of repetitions found or "No repetitions" if none are found.
 */
fun calculateRepetitions(polarNumbers: List<Pair<Double, Double>>): String {

    var repetitions = 0

    // Check each pair of complex numbers for repetitions
    for (i in polarNumbers.indices) {
        for (j in i + 1 until polarNumbers.size) {
            if (polarNumbers[i].first == polarNumbers[j].first && polarNumbers[i].second == polarNumbers[j].second) {
                repetitions++
            }
        }
    }

    return if (repetitions == 0) {
        "No repetitions"
    } else {
        "Repetitions found: $repetitions"
    }
}

// Sample Test Case
val polarInput = listOf(
    Pair(3.0, 0.0),
    Pair(2.0, 1.2),
    Pair(3.0, 1.2)
)