Challenge 📝
Given is an array times
and a number totalTime
. The array times
contains the time taken by a candidate to solve each question in an imaginary coding interview, and totalTime
is the total time taken by the candidate to complete the interview.
The interview has the following criteria:
The maximum time allowed for each question is as follows:
The function should return "qualified" if the candidate meets all the criteria. Otherwise, it should return "disqualified".
Examples:
// Example 1
let times = [8, 9, 10, 13, 14, 15, 18, 19];
let totalTime = 110;
console.log(isQualified(times, totalTime)); // Output: "qualified"
// Example 2
times = [8, 11, 10, 13, 14, 15, 18, 19];
totalTime = 110;
console.log(isQualified(times, totalTime)); // Output: "disqualified"
// Explanation: The second easy question took 11 minutes, which is more than the allowed 10 minutes.