Modo entrevista. Cronômetro de 7 min, sem dicas e sem autocompletar
Largest two-digit number
FácilStrings7 min
The input is a string of digits, at least two characters long. Write a function maxTwoDigit(digits) that finds the largest number made of two neighbouring digits and returns it as a number.
Exemplos
maxTwoDigit('34987')Retorna 98
maxTwoDigit('1205')Retorna 20
maxTwoDigit('05')Retorna 5
Cobrada em Druva · Fonte
Carregando o editor...
- Entrada
maxTwoDigit('34987')Esperado98 - Entrada
maxTwoDigit('1205')Esperado20 - Entrada
maxTwoDigit('05')Esperado5
Os testes ocultos rodam no envio