[Solved] Check if array Is235
Try this, I tested it and it works, you should use the remainder operator %: public class Array { public static void main(String[] args) { int[] arr = {2, 3, 5, 7, 11}; System.out.println(is235Array(arr)); } public static int is235Array(int[] a) { int countOne = 0; int countTwo = 0; for (int i : a) { … Read more