@@ -0,0 +1,716 @@
+package array2;%0A%0Apublic class ModThreeTest %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%0A%09%09ModThreeTest test = new ModThreeTest();%0A%09%09System.out.println(test.modThree(new int%5B%5D %7B 2, 1, 3, 5 %7D));%0A%09%09System.out.println(test.modThree(new int%5B%5D %7B 2, 1, 2, 5 %7D));%0A%09%09System.out.println(test.modThree(new int%5B%5D %7B 2, 4, 2, 5 %7D));%0A%09%7D%0A%0A%09public boolean modThree(int%5B%5D nums) %7B%0A%09%09int countEven = 0;%0A%09%09int countOdd = 0;%0A%0A%09%09for (int i = 0; i %3C nums.length; i++) %7B%0A%09%09%09if (nums%5Bi%5D %25 2 == 0) %7B%0A%09%09%09%09countEven++;%0A%09%09%09%09if (countOdd %3E 0)%0A%09%09%09%09%09countOdd = 0;%0A%09%09%09%09if (countEven %3E= 3)%0A%09%09%09%09%09return true;%0A%09%09%09%7D else %7B%0A%09%09%09%09countOdd++;%0A%09%09%09%09if (countEven %3E 0)%0A%09%09%09%09%09countEven = 0;%0A%09%09%09%09if (countOdd %3E= 3)%0A%09%09%09%09%09return true;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return false;%0A%09%7D%0A%7D%0A

Add ModThreeTest