Practice · 4 of 4
Distance Between
CHALLENGE
Difficulty: beginner+25 XP
Implement long index_of(const int *begin, const int *end, int target) returning the ELEMENT DISTANCE from begin to the first match, or -1 if absent. Compute with pointer subtraction on a found position.
Press Submit to check your solution.
Back to lesson: Practice: Arithmetic Workbench