OddEvenDistance

Write a method that will check an array for an odd number followed by an even number. Find the first odd number. Then, after finding the odd number, start looking at that position for an even number and then return the distance between them. Return -1 if there are no odd numbers or no odd numbers followed by an even number.

×
New Download