DSA SheetLesson · no judge

CODE DRILL 1 · RUN ONLY

Write it, run it, read the output

This is a scratch drill — your code runs, nothing is graded or recorded. No test cases, no expected output, no verdict.

TASK

Read n, x, and the n array values in the stated input order. Print the 0-based index of the first occurrence of x, or -1 if x is absent; for the concrete input, the output must be 1.

C++
Loading editor…

OUTPUT

Sample
1

What a finished answer prints, from the lesson. Nothing has run yet — press Run and this is replaced by your program’s own output.

Previous · Popular Online PlatformsNext part · Code drill 2