We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Angry Professor
Angry Professor
Sort by
recency
|
1990 Discussions
|
Please Login in order to post a comment
//JAVA15; import java.io.; import java.util.; import java.util.stream.*; import static java.util.stream.Collectors.toList;
class Result {
}
public class Solution { public static void main(String[] args) throws IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH")));
}
The description is incorrectly written. It states:
So, when you meet the threshold, you return "YES" because the class should go on, but on the examples it says that returning "YES" implies the class will be cancelled.
Poorly written, should be fixed.
public static String angryProfessor(int k, List a) { // Write your code here int onTimeCount = 0;
}
def angryProfessor(k, a): count = 0 for i in a: if i <= 0: count += 1 if count >= k: return "NO" else: return "YES"
Here is my Python one-liner