Problem Description

Read sorted array of n integers and target x, write function bsearch(arr,x) returning index (0-based) or -1. Output result.

Input Format

First line n. Second line n integers sorted. Third line x.

Output Format

One integer index.

Sample Test Case

Input:
5 1 3 5 7 9 7
Output:
3

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next