Skip to content
C

Linear Search

Easyjavapythonccppjavascript

Given an array and a target value, find the first position where the target occurs.

Input Format

The first line contains two integers N and target. The second line contains N space-separated integers.

Output Format

Print the zero-based index of the first occurrence of target, or -1 if it is absent.

Input (stdin)

Output

Run your code to see output here...