Search⌘ K

Challenge 1: Average of Numbers

Explore how to solve the problem of calculating the average of numbers in an array using recursion. Understand how to define the function to recursively sum array elements and then divide by the count. This lesson helps you apply recursion with arrays and prepares you for similar coding interview questions.

Problem Statement

Implement a function that computes the average of all the numbers in an array.

If we have nn numbers and each number is denoted by aia_i (wherei=0,1,2,...,n1)(where \: i = 0, 1, 2, ..., n-1) ...