Codepath

Calling Mississippi

Unit 3 Session 1 (Click for link to problem statements)

U-nderstand

Understand what the interviewer is asking for by using test cases and questions about the problem.

  • When we call the function, what will that input parameter be used for?
    • It will be the upper bound (exclusive) of the range.

P-lan

Plan the solution with appropriate visualizations and pseudocode.

General Idea: Call the function with the input we'd use for the range function's upper bound.

1) Determine the bounds of range we need to iterate over the numbers (1, 2, 3, 4, 5)
2) Identify specifically the upper bound (exclusive)
3) Call the function with that upper bound as the input

I-mplement

count_mississippi(6)
Fork me on GitHub