You are viewing a single comment's thread. Return to all comments →
For Java 7 / 8, all the tests pass but then, I see this message:
We couldn't process your submission. Please try to submit your code again.
public static void plusMinus(List<Integer> arr) { double posCnt = 0; double negCnt = 0; double zeroCnt = 0; for (int num : arr) { if (num > 0) { posCnt++; } else if (num < 0) { negCnt++; } else { zeroCnt++; } } System.out.println(String.format("%6f", posCnt / arr.size())); System.out.println(String.format("%6f", negCnt / arr.size())); System.out.println(String.format("%6f", zeroCnt / arr.size())); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →
For Java 7 / 8, all the tests pass but then, I see this message: