forked from RyanFehr/HackerRank
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolution.java
More file actions
Latest commit
37 lines (34 loc) · 1023 Bytes
/
Copy pathSolution.java
File metadata and controls
37 lines (34 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//Problem: https://www.hackerrank.com/challenges/angry-professor
//Java 8
importjava.io.*;
importjava.util.*;
publicclassSolution {
publicstaticvoidmain(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scannerinput = newScanner(System.in);
intT = input.nextInt();
testCases:
for(inti = 0; i < T; i++)
{
intn = input.nextInt();
intk = input.nextInt();
intonTime = 0;
for(intj = 0; j < n; j++)
{
intarrivalTime = input.nextInt();
if(arrivalTime <= 0)
{
onTime++;
}
}
if(onTime >= k)
{
System.out.println("NO");
}
else
{
System.out.println("YES");
}
}
}
}