Sort by

recency

|

1987 Discussions

|

  • + 0 comments

    def angryProfessor(k, a): count = 0 for i in a: if i <= 0: count += 1 if count >= k: return "NO" else: return "YES"

  • + 0 comments

    Here is my Python one-liner

    def angryProfessor(k, a):
        return 'YES' if len([i for i in a if i <= 0]) < k else 'NO'
    
  • + 1 comment

    This question is poorly written. HackerRank Authors need to improve the question's quality. Keep the questions straight forward, to understand.

  • + 0 comments

    Here is my solution in JavaScript

    let onTime = 0;
    for(let i = 0; i < a.length; i++){
    	if(a[i] <= 0){
    		onTime++
    	}
    }
    return onTime < k ? "YES" : "NO"
    
  • + 0 comments

    Here is problem solution in pYthon, Java, C++, C and Javascript - https://programmingoneonone.com/hackerrank-angry-professor-problem-solution.html