Try a sample exercise
For a zero-indexed list [7, 4, 4, 9], a search function should return the first index matching the target and a “not found” result otherwise. Give two tests that distinguish required behaviours.
Check your answer
A search for 4 should return index 1, exposing an implementation that overwrites the first match with index 2. A search for 6 should return the documented “not found” result, rather than a misleading valid index.