/**
 * Given a number line representation and an array of integers, 
 * the function finds the sum of the integers at the indices corresponding 
 * to the number line representation and returns it.
 *
 * @param n The length of the number line representation.
 * @param arr An array of integers.
 * @return The sum of the integers at the indices corresponding 
 * to the number line representation.
 *
 * Example:
 * findSum(5, intArrayOf(2, 4, 6, 8, 10)) // 12
 */
fun findSum(n: Int, arr: IntArray): Int {

    var totalSum = 0
    for (i in 0 until n) {
        totalSum += arr[i]
    }
    return totalSum
}
/**
 * Given a number line representation and an array of integers, 
 * the function finds the sum of the integers at the indices corresponding 
 * to the number line representation and returns it.
 *
 * @param n The length of the number line representation.
 * @param arr An array of integers.
 * @return The sum of the integers at the indices corresponding 
 * to the number line representation.
 *
 * Example:
 * findSum(5, intArrayOf(2, 4, 6, 8, 10)) // 12
 */
fun findSum(n: Int, arr: IntArray): Int {
/**
 * Given a number line representation and an array of integers, 
 * the function finds the sum of the integers at the indices corresponding 
 * to the number line representation and returns it.
 *
 * @param n The length of the number line representation.
 * @param arr An array of integers.
 * @return The sum of the integers at the indices corresponding 
 * to the number line representation.
 *
 * Example:
 * findSum(5, intArrayOf(2, 4, 6, 8, 10)) // 12
 */
fun findSum(n: Int, arr: IntArray): Int {

    var totalSum = 0
    for (i in 0 until n) {
        totalSum += arr[i]
    }
    return totalSum
}