You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Understand what the interviewer is asking for by using test cases and questions about the problem.
P-lan
Plan the solution with appropriate visualizations and pseudocode.
General Idea: Loop through a list of numbers, and if a number matches the target, add its index to a results list.
1) Create an empty list to hold the results
2) Loop through the indices of the input list
a) If the element at that index matches the target, add the index to the results list
3) Return the results list
⚠️ Common Mistakes
Be sure you are adding the INDEX of each match to your results list -- not the match itself!