First Index And Last Index
easy
1. You are given a number n, representing the size of array a. 2. You are given n numbers, representing elements of array a. Asssumption - Array is sorted. Array may have duplicate values.
Constraints
1 <= n <= 1000 1 <= n1, n2, .. n elements <= 100 1 <= d <= 100
Format
Input
A number n n1 n2 .. n number of elements A number d
Output
A number representing first index A number representing last index
Example
Sample Input
15
1
5
10
15
22
33
33
33
33
33
40
42
55
66
77
33
Sample Output
5
9
Question Video