/**
 * Given a list of dancers and a target value, find all pairs of dancers 
 * whose index sum is equal to the target.
 *
 * @param dancerList List of dancers represented by their dance skill level.
 * @param target The target value for the sum of indices.
 * @return List of pairs of dancers whose index sum is equal to the target.
 */
fun findPairs(dancerList: List<Int>, target: Int): List<Pair<Int, Int>> {

    val result = mutableListOf<Pair<Int, Int>>()  // Store the pairs of dancers

    // Traverse through the list of dancers
    for (i in dancerList.indices) {
        // Perform inner loop starting from i+1 to avoid duplicates
        for (j in i + 1 until dancerList.size) {
            // Check if the sum of indices is equal to the target
            if (i + j == target) {
                result.add(Pair(i, j))  // Add the pair of indices to the result list
            }
        }
    }

    return result
}
/**
 * Given a list of dancers and a target value, find all pairs of dancers 
 * whose index sum is equal to the target.
 *
 * @param dancerList List of dancers represented by their dance skill level.
 * @param target The target value for the sum of indices.
 * @return List of pairs of dancers whose index sum is equal to the target.
 */
fun findPairs(dancerList: List<Int>, target: Int): List<Pair<Int, Int>> {
/**
 * Given a list of dancers and a target value, find all pairs of dancers 
 * whose index sum is equal to the target.
 *
 * @param dancerList List of dancers represented by their dance skill level.
 * @param target The target value for the sum of indices.
 * @return List of pairs of dancers whose index sum is equal to the target.
 */
fun findPairs(dancerList: List<Int>, target: Int): List<Pair<Int, Int>> {

    val result = mutableListOf<Pair<Int, Int>>()  // Store the pairs of dancers

    // Traverse through the list of dancers
    for (i in dancerList.indices) {
        // Perform inner loop starting from i+1 to avoid duplicates
        for (j in i + 1 until dancerList.size) {
            // Check if the sum of indices is equal to the target
            if (i + j == target) {
                result.add(Pair(i, j))  // Add the pair of indices to the result list
            }
        }
    }

    return result
}