0, 0, 7 in order
EasyArrays7 min
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.
Examples
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
Loading the editor...
- Input
has007([ 1, 0, 2, 4, 0, 5, 7 ])Expectedtrue - Input
has007([ 1, 7, 0, 0 ])Expectedfalse - Input
has007([ 0, 1, 7, 0 ])Expectedfalse
Hidden tests run on Submit