Skip to content

Instantly share code, notes, and snippets.

@rachidelaid
Created May 19, 2022 07:14
Show Gist options
  • Save rachidelaid/e556cadf6a05bbcd14b79f78d2d2e37f to your computer and use it in GitHub Desktop.
Save rachidelaid/e556cadf6a05bbcd14b79f78d2d2e37f to your computer and use it in GitHub Desktop.
this is the solution to the angry teacher algo on hackerrank https://www.hackerrank.com/challenges/angry-professor/problem?isFullScreen=true
function angryProfessor(k, a) {
const onTimeStudents = a.filter(s => s <= 0).length
return onTimeStudents >= k ? "NO" : "YES"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment