@@ -0,0 +1,558 @@
+package array2;%0A%0Apublic class TripleUpTest %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%0A%09%09TripleUpTest test = new TripleUpTest();%0A%09%09System.out.println(test.tripleUp(new int%5B%5D %7B 1, 4, 5, 6, 2 %7D));%0A%09%09System.out.println(test.tripleUp(new int%5B%5D %7B 1, 2, 3 %7D));%0A%09%09System.out.println(test.tripleUp(new int%5B%5D %7B 1, 2, 4 %7D));%0A%09%7D%0A%0A%09public boolean tripleUp(int%5B%5D nums) %7B%0A%09%09if (nums.length %3C 3)%0A%09%09%09return false;%0A%0A%09%09for (int i = 0; i %3C nums.length - 2; i++) %7B%0A%09%09%09if (nums%5Bi%5D + 1 == nums%5Bi + 1%5D && nums%5Bi + 1%5D + 1 == nums%5Bi + 2%5D)%0A%09%09%09%09return true;%0A%09%09%7D%0A%09%09return false;%0A%09%7D%0A%7D%0A

Add TripleUpTest