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

111
Views
Why is my first answer correct but my second answer off by 1?

I am not allowed to use Math.max() or Math.min() to solve this problem

const findMinAndMax = function(list) {
  let orderedList = list.sort();
  let min = orderedList[0];
  let max = orderedList[orderedList.length - 1];
  return [min, max];
}; 

// [1, 100, 2, 200, 300, 3] answer [1, 300] 
// [9, -9, 10, -10] answer is supposed to be [-10, 10] but i get [-10, 9]
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!