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 0.