Code Lab

Modo entrevista. Cronômetro de 3 min, sem dicas e sem autocompletar

Spam check

FácilStrings3 min

Write a function checkSpam(text) that returns true if the string contains free money or xxx, and false if not. Letter case does not matter.

Exemplos

checkSpam('Get FREE money now')

Retorna true

checkSpam('xXx files')

Retorna true

A match at the very start of the string counts too.
checkSpam('Release notes')

Retorna false

Fonte

Carregando o editor...
  1. EntradacheckSpam('Get FREE money now')
    Esperadotrue
  2. EntradacheckSpam('xXx files')
    Esperadotrue
  3. EntradacheckSpam('Release notes')
    Esperadofalse

Os testes ocultos rodam no envio