The alternate solution to this challenge was using the if-else expression. The logic behind the code is pretty much the same as the match solution. The only difference is that the if-else solution takes a second parameter which is the length - 1 of list. In other words, if our list has 5 elements, we need to pass 4 to sum.
The first case is represented by if which is now checking if we have reached the start of the list (index < 0). The second case is represented by else which is adding the last element of the list (element at index 4) to the sum call sum(numberList, index-1). sum will now look at the list starting from the second to last index, i.e., 3. This will continue until we have reached the first element of the list.