Mental Model
Find where a number first appears and where it last appears in a list by checking each item from start to end.
Analogy: Imagine looking for a friend's name in a guest list. You note the first time you see their name and keep looking until you find the last time it appears.
Index: 0 1 2 3 4 5 6
List: 2 -> 3 -> 5 -> 3 -> 7 -> 3 -> 9
↑ ↑
first occurrence last occurrence