You are viewing a single comment's thread. Return to all comments →
I agree, a for loop or a simple filter will do O(n):
function angryProfessor(k, a) { const t = a.filter(i => i <= 0) return t.length >= k ? 'NO' : 'YES' }
Seems like cookies are disabled on this browser, please enable them to open this website
Angry Professor
You are viewing a single comment's thread. Return to all comments →
I agree, a for loop or a simple filter will do O(n):