We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Simple Algorithms

If you've heard the exaggerated stories about LeetCode and whiteboarding interviews, you might think the word "algorithm" is synonymous with "hard problem."

It's not.

Some algorithms are quite simple, and some are quite complex. But they're all recipes for solving problems.

Assignment

Let's calculate the "reach" of a group of LockedIn influencers so we can estimate how many views a post will get if they all reshare it.

Complete the summed function. It's a slightly modified version of the add algorithm from before, but instead of just two numbers, a and b, it accepts a list of numbers and returns the sum of all of them.

The sum of an empty list should be zero.