Write a function has007(numbers) that returns true if the array has 0, 0 and 7 in this order, and false if not. Other numbers may stand between them.
has007([1, 0, 2, 4, 0, 5, 7])Returns true
has007([1, 7, 0, 0])Returns false
has007([0, 1, 7, 0])Returns false
Asked at Druva · Source
has007([ 1, 0, 2, 4, 0, 5, 7 ])truehas007([ 1, 7, 0, 0 ])falsehas007([ 0, 1, 7, 0 ])falseHidden tests run on Submit.