You are viewing a single comment's thread. Return to all comments →
private static String angryProfessor(int k, int[] ar) { int count = 0; String str = ""; for (int i = 0; i < ar.length; i++) { if (ar[i] <= 0) { count++; } } if (count >= k) { str = "NO"; } else { str = "YES"; } return str; }
Seems like cookies are disabled on this browser, please enable them to open this website
Angry Professor
You are viewing a single comment's thread. Return to all comments →
private static String angryProfessor(int k, int[] ar) { int count = 0; String str = ""; for (int i = 0; i < ar.length; i++) { if (ar[i] <= 0) { count++; } } if (count >= k) { str = "NO"; } else { str = "YES"; } return str; }