Crea una función para comprobar si un candidato está calificado en una entrevista de programación imaginaria de una startup tecnológica imaginaria.
Los criterios para que un candidato esté calificado en la entrevista de programación son:
Si se cumplen todas las condiciones anteriores, devuelve "qualified"; de lo contrario, devuelve "disqualified".
Se te dará un arreglo con el tiempo que tardó un candidato en resolver una pregunta específica y el tiempo total que tardó en completar la entrevista.
Dado un arreglo, en una condición verdadera siempre tendrá el formato [very easy, very easy, easy, easy, medium, medium, hard, hard].
El tiempo máximo para completar la entrevista incluye un margen de 20 minutos.
interview([5, 5, 10, 10, 15, 15, 20, 20], 120) ➞ "qualified"
interview([2, 3, 8, 6, 5, 12, 10, 18], 64) ➞ "qualified"
interview([5, 5, 10, 10, 25, 15, 20, 20], 120) ➞ "disqualified"
// Exceeded the time limit for a medium question.
interview([5, 5, 10, 10, 15, 15, 20], 120) ➞ "disqualified"
// Did not complete all the questions.
interview([5, 5, 10, 10, 15, 15, 20, 20], 130) ➞ "disqualified"
// Solved all the questions in their respected time limits but exceeded the total time limit of the interview.Intenta resolver el problema usando únicamente métodos de arreglos.