@@ -0,0 +1,1126 @@
+//https://www.hackerrank.com/challenges/angry-professor%0Aimport java.io.*;%0A%0Apublic class Solution %7B%0A  public static void main(String%5B%5D args) throws IOException %7B%0A    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A    %0A    //For each test%0A    for(byte T = Byte.parseByte(br.readLine()); T %3E 0; --T)%7B%0A      %0A      //Get # students (N) and minimum not-cancelled threshold (K)%0A      String%5B%5D line = br.readLine().split(%22 %22);%0A      short K = Short.parseShort(line%5B1%5D);%0A      short N = (short)(Short.parseShort(line%5B0%5D) - K + 1);%0A      %0A      //Get arrival times%0A      line = br.readLine().split(%22 %22);%0A      %0A      //Check if class is cancelled%0A      boolean isCancelled = true;%0A      for(short i = 0; i %3C N; ++i)%7B%0A        %0A        //If student arrived on time or early%0A        if(Byte.parseByte(line%5Bi%5D) %3C 1)%7B%0A          ++N;%0A          %0A          //If enough students arrived to give class%0A          if(--K %3C 1)%7B%0A            isCancelled = false;%0A            break;%0A          %7D%0A        %7D%0A      %7D%0A      %0A      //Print if class is cancelled%0A      System.out.println((isCancelled) ? %22YES%22 : %22NO%22);%0A    %7D%0A  %7D%0A%7D%0A

Create angry-professor.java