

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Welcome to Data Structures and Algorithms
incomplete
2: Find Minimum
incomplete
3: What Is an Algorithm?
incomplete
4: Simple Algorithms
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
If you've heard (usually exaggerated) stories about Leetcode and whiteboarding interviews, you might hear the word "algorithm" and think it's synonymous with "hard problem." That's really not the case, and believing it will only psych you out.
We suffer more often in imagination than in reality
-- Seneca
Algorithms, like anything else, can be understood by breaking them down piece by piece. Take a look at the following algorithm for adding two numbers--it's dead simple:
a and ba and b using the + operator, and assign the result to a new variable, sumsum variableFor the LockedIn influencer dashboard, we need to calculate the total reach of a group of influencers to estimate how many views a post will get if they all share it.
Complete the summed function. It's a slightly modified version of the algorithm above. 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.