The array of numbers stored in arr and from the position in the array where a 1 is, return the number of spaces either left or right.
Have the function ArrayChallenge(arr) take the array of numbers stored in arr and from the position in the array where a 1 is, return the number of spaces either left or right you must move to reach an enemy which is represented by 2. The array will contain any number of 0's and 2's, but only a single 1. It may not contain any 2's at all as well , where in that case the program should return 0, in java