Angry professor problem solution
This problem is taken from Hakerrank : A Discrete Mathematics professor has a class of N N students. Frustrated with their lack of discipline, he decides to cancel class if fewer than K K students are present when class starts. Given the arrival time of each student, determine if the class is canceled. Input Format The first line of input contains T T , the number of test cases. Each test case consists of two lines. The first line has two space-separated integers, N N (students in the class) and K K (the cancelation threshold). The second line contains N N space-separated integers ( a 1 , a 2 , … , a N a 1 , a 2 , … , a N ) describing the arrival times for each student. Note: Non-positive arrival times ( a i ≤ 0 a i ≤ 0 ) indicate the student arrived early or on time; positive arrival times ( a i > 0 a i > 0 ) indicate the student arrived a i a i minutes late. Output Format For each test case, print the word YES if the class is canceled or NO if it...