Modo entrevista. Cronômetro de 7 min, sem dicas e sem autocompletar
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.
Exemplos
has007([1, 0, 2, 4, 0, 5, 7])Retorna true
has007([1, 7, 0, 0])Retorna false
has007([0, 1, 7, 0])Retorna false
Cobrada em Druva · Fonte
Carregando o 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
Os testes ocultos rodam no envio