@@ -0,0 +1,895 @@
+package array2;%0A%0A/*%0A * We'll say that a value is %22everywhere%22 in an array if for every pair of%0A * adjacent elements in the array, at least one of the pair is that value.%0A * Return true if the given value is everywhere in the array.%0A * %0A * isEverywhere(%7B1, 2, 1, 3%7D, 1) --%3E true%0A * isEverywhere(%7B1, 2, 1, 3%7D, 2) --%3E false%0A * isEverywhere(%7B1, 2, 1, 3, 4%7D, 1) --%3E false%0A */%0Apublic class IsEverywhereTest %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09%0A%09%09IsEverywhereTest test = new IsEverywhereTest();%0A%09%09System.out.println(test.isEverywhere(new int%5B%5D %7B1, 2, 1, 3%7D, 1));%0A%09%09System.out.println(test.isEverywhere(new int%5B%5D %7B1, 2, 1, 3%7D, 2));%0A%09%09System.out.println(test.isEverywhere(new int%5B%5D %7B1, 2, 1, 3, 4%7D, 1));%0A%09%7D%0A%0A%09public boolean isEverywhere(int%5B%5D nums, int val) %7B%0A%09%09for (int i = 0; i %3C nums.length - 1; i++) %7B%0A%09%09%09if (nums%5Bi%5D != val && nums%5Bi + 1%5D != val)%0A%09%09%09%09return false;%0A%09%09%7D%0A%09%09return true;%0A%09%7D%0A%7D%0A

Create IsEverywhereTest.java