difficulty | OAs | projects | |||
---|---|---|---|---|---|
|
|
|
https://the-winter.github.io/codingjs/exercise.html?name=tenRun&title=Array-2
Para cada múltiplo de 10 no array fornecido, altere todos os valores seguintes para ser esse múltiplo de 10, até encontrar outro múltiplo de 10. Portanto, [2, 10, 3, 4, 20, 5] resulta em [2, 10, 10, 10, 20, 20].
Exemplo
tenRun([2, 10, 3, 4, 20, 5]) → [2,10,10,10,20,20]
tenRun([10, 1, 20, 2]) → [10,10,20,20]
tenRun([10, 1, 9, 20]) → [10,10,10,20]
↩️ Voltar