← Innovation PlaygroundMISSION 26 / 100 · Coding Studio

Search algorithm

Find the first matching value in [4, 7, 2, 9, 5].

1. Explore the controls

Change the inputs and observe the model's response.

2. Observe the results

Index (-1 if missing)0

How the model works

for i, value in enumerate(items):
  if value == target: return i
return -1
YOUR MISSION

3. Reach the target

Adjust the controls to obtain the following output. Multiple valid solutions may exist.

Index (-1 if missing)3
Need a hint?

The fourth item has index 3.

Explore, then check your answer.

Simplified educational model. No real hardware is controlled. Code examples are illustrative and not executed as arbitrary programs.