Modo entrevista. Temporizador de 7 min, sin pistas y sin autocompletado
0, 0, 7 in order
FácilArrays7 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.
Ejemplos
has007([1, 0, 2, 4, 0, 5, 7])Devuelve true
has007([1, 7, 0, 0])Devuelve false
has007([0, 1, 7, 0])Devuelve false
Preguntada en Druva · Fuente
Cargando el editor…
- Entrada
has007([ 1, 0, 2, 4, 0, 5, 7 ])Esperadotrue - Entrada
has007([ 1, 7, 0, 0 ])Esperadofalse - Entrada
has007([ 0, 1, 7, 0 ])Esperadofalse
Las pruebas ocultas se ejecutan al enviar