Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

106
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!