Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

168
Visualizações
UMM, por lo que IV regresa como inválido XLI también sale inválido y también MDC y MCD regresan como inválidos, creo que están sucediendo MUY cosas menores Ayuda, por favor

if (saltar) { saltar = falso;

 }else { if (nextValue > romanValue) { if (romanValue == 5 romanValue == 50 romanValue == 500){ return "Invalid"; } arabicNumber = arabicNumber + nextValue - romanValue; skip = true; var nextnextValue = dict[romanNumber[i+2]]; if (nextnextValue == romanValue) return "Invalid";

} else { arabicNumber = arabicNumber + romanValue;

 }

} UMM entonces IV regresa como inválido XLI también sale inválido y también MDC y MCD regresan como inválidos, creo que hay cosas MUY menores en la función RomanToArabic(romanNumber){ var dict = { "I":1, "V": 5, "X":10, "L":50, "C":100, "D":500, "M":1000 };

numeroromano = numeroromano.toUpperCase();

var valorromano = "";

var duplicateCheck = falso;

var valor anterior = 0;

var numerosconsecutivos = 0;

var saltar = falso;

var numero arabe = 0;

for(var i = 0; i < númeroromano.longitud; i++) { valorromano = dict[númeroromano[i]];

 if (romanValue == 5 romanValue == 50 romanValue == 500) { duplicateCheck = true; if (duplicateCheck && romanValue == 5 romanValue == 50 romanValue == 500) { return "Invalid"; } }

if (previousValue == romanValue) { NúmerosConsecutivos = NúmerosConsecutivos + 1;

 if (consecutiveNumbers >= 3 && (romanValue == 1 romanValue == 10 romanValue == 100 romanValue == 1000)) { return "Invalid"; } } else { consecutiveNumbers = 0; } var nextValue = dict[romanNumber[i+1]]; if (skip) { skip = false; }else { if (nextValue > romanValue) { if (romanValue == 5 romanValue == 50 || romanValue == 500){ return "Invalid"; } arabicNumber = arabicNumber + nextValue - romanValue; skip = true; var nextnextValue = dict[romanNumber[i+2]]; if (nextnextValue == romanValue) return "Invalid";

} else { arabicNumber = arabicNumber + romanValue;

 }

}

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda