Angry Professor

Pratik Somwanshi
Hackerrank Algorithms
1 min readJan 3, 2018

Hello World!

Let’s get going with the problem Angry Professor on HackerRank. You may click on the title to read the problem statement. So let’s start…

We have been given a list of N integers, i.e. their arrival times. We also have a threshold K, which defines the boundary condition. If less than K students are present, then the teacher won’t start the class.

This has a very simple solution. We need to count all the negative numbers as well as zeros, i.e. students those arrived early or just on time. If th count is greater than or equal to K, then print “YES”, else print “NO”.

Open for suggestions. The code for this problem in Python3 can be found here.

Happy coding…

--

--