All Indices of Number -Coding NInjas Solutions

 All Indices of Number
Given an array of length N and an integer x, you need to find all the indexes where x is present in the input array. Save all the indexes in an array (in increasing order).

Do this recursively. Indexing in the array starts from 0.

Input Format :
Line 1 : An Integer N i.e. size of array
Line 2 : N integers which are elements of the array, separated by spaces
Line 3 : Integer x
Output Format :
indexes where x is present in the array (separated by space)
Constraints :

1 <= N <= 10^3

Sample Input :
5
9 8 10 8 8
8
Sample Output :
1 3 4
SOURCE CODE:
array, indexes, indices, an array, all the, the indexes, in the, all the indexes, all indices of, indices of number, of number given, number given an
 All Indices of Number -Coding NInjas Solutions


Post a Comment

0 Comments