Can you find the needle in the haystack?
Write a function
findNeedle() that takes an
array full of junk but containing one
After your function finds the needle it should return a message (as a string) that says:
"found the needle at position " plus the
index it found the needle, so:
"found the needle at position 5"
The solution in Java code
A more succinct solution, without using a for loop:
Test cases to validate our solution