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

306
Views
How many nines? Codewars

https://www.codewars.com/kata/5e18743cd3346f003228b604

i am working on this task - "How many Integers in the range [0..n] contain at least one 9 in their decimal representation?". My function passed all test but final output is "Execution Timed Out (12000 ms)" what probably means that my function algorithm is inefficient. What's wrong there? Appriciate any help.

function nines(n) {
    let amountOfNines = 0;

    for (let i = 0; i <= n; i++) {
        if (/9/.test(i)) amountOfNines++;
    }

    return BigInt(amountOfNines);
}
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!