Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

111
Vistas
Probability function to show how a string matches other strings based on vowels

My question is how can i make a Probability function to show how a string that i add matches other strings based on vowels

input text(reading in from the same directory and it is in columns like so)
Lorem
ipsum
dolo
  var fs = require('fs');
    var array = fs.readFileSync('input.txt').toString().split("\n");
    const asc = array.sort((a,b) => a.length - b.length);
    parts = 4;
    function splitToChunks(array, parts) {
      let result = [];
      for (let i = parts; i > 0; i--) {
         result.push(array.splice(0, Math.ceil(array.length / i)));
     }
    function isVowel(x) {
        return (/[aeiou]/i).test(x);
    }
    function countVowels(strChar, strchar2) {
        var count1 = strChar.split('').filter(isVowel).length;
        var count2 = strchar2.split('').filter(isVowel).length;

        if (count1 === count2) return strChar.localeCompare(strchar2);

        return count1 - count2
    }
    for (let i = 0; i < result.length; i++) {
        console.log(result[i].sort(countVowels));
    }
    return result;
    }
    splitToChunks(asc, 4);
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda