A Needle in the Haystack
Submit solution
Points:
1
Time limit:
2.0s
Memory limit:
256M
Problem types
Allowed languages
Python
Write a program that finds the word needle in a list of words.
The position should start from 0.
Input
The first line contains an integer, n, the number of words.
The second line contains n words separated by spaces.
Exactly one of the words will be needle.
Output
Output:
found the needle at position X
where X is the position of needle.
Sample Input
5
hay junk needle hay more
Sample Output
found the needle at position 2
Comments