/**
 * This exercise requires you to find the intersection of two lists: the indexes and their corresponding absolute values.
 * Complete the code to find the intersection using the 'withIndex' function and the concept of absolute value.
 *
 * @param numbers A list of numbers.
 * @return A list containing pairs of the index and corresponding absolute value for each element in the input list.
 *
 * Example:
 * absoluteValueIntersection(listOf(-3, 4, -2, 0, 5)) returns [(0, 3), (1, 4), (2, 2), (3, 0), (4, 5)]
 */
fun absoluteValueIntersection(numbers: List<Int>): List<Pair<Int, Int>> {

    // Empty list to store the intersection pairs
    val intersection = mutableListOf<Pair<Int, Int>>()

    // Iterate over the input list using 'withIndex'
    for ((index, number) in numbers.withIndex()) {
        // Use the 'Math.abs' function to find the absolute value of each element
        val absoluteValue = Math.abs(number)

        // Add the pair (index, absoluteValue) to the intersection list
        intersection.add(index to absoluteValue)
    }

    // Return the final intersection list
    return intersection
}
/**
 * This exercise requires you to find the intersection of two lists: the indexes and their corresponding absolute values.
 * Complete the code to find the intersection using the 'withIndex' function and the concept of absolute value.
 *
 * @param numbers A list of numbers.
 * @return A list containing pairs of the index and corresponding absolute value for each element in the input list.
 *
 * Example:
 * absoluteValueIntersection(listOf(-3, 4, -2, 0, 5)) returns [(0, 3), (1, 4), (2, 2), (3, 0), (4, 5)]
 */
fun absoluteValueIntersection(numbers: List<Int>): List<Pair<Int, Int>> {
/**
 * This exercise requires you to find the intersection of two lists: the indexes and their corresponding absolute values.
 * Complete the code to find the intersection using the 'withIndex' function and the concept of absolute value.
 *
 * @param numbers A list of numbers.
 * @return A list containing pairs of the index and corresponding absolute value for each element in the input list.
 *
 * Example:
 * absoluteValueIntersection(listOf(-3, 4, -2, 0, 5)) returns [(0, 3), (1, 4), (2, 2), (3, 0), (4, 5)]
 */
fun absoluteValueIntersection(numbers: List<Int>): List<Pair<Int, Int>> {

    // Empty list to store the intersection pairs
    val intersection = mutableListOf<Pair<Int, Int>>()

    // Iterate over the input list using 'withIndex'
    for ((index, number) in numbers.withIndex()) {
        // Use the 'Math.abs' function to find the absolute value of each element
        val absoluteValue = Math.abs(number)

        // Add the pair (index, absoluteValue) to the intersection list
        intersection.add(index to absoluteValue)
    }

    // Return the final intersection list
    return intersection
}