package array1;

/*
 * Given 2 arrays of ints, a and b, return true if they have the same first
 * element or they have the same last element. Both arrays will be length 1 or
 * more.
 * 
 * commonEnd({1, 2, 3}, {7, 3}) --> true
 * commonEnd({1, 2, 3}, {7, 3, 2}) --> false
 * commonEnd({1, 2, 3}, {1, 3}) --> true
 */
public class CommonEndTest {

	public static void main(String[] args) {
		CommonEndTest test = new CommonEndTest();
		System.out.println(test.commonEnd(new int[] {1, 2, 3},
						   new int[] {7, 3}));
		System.out.println(test.commonEnd(new int[] {1, 2, 3},
						   new int[] {7, 3, 2}));
		System.out.println(test.commonEnd(new int[] {1, 2, 3},
						   new int[] {1, 3}));
	}
	
	public boolean commonEnd(int[] a, int[] b) {
		  return (a[0] == b[0] || a[a.length - 1] == b[b.length - 1]);
	}
}
@@ -480,38 +480,32 @@
 %5D %7B1, 2, 3%7D,%0A%09%09%09
-%09%09%09   
 new int%5B%5D %7B7, 3%7D
@@ -504,24 +504,24 @@
 %5D %7B7, 3%7D));%0A
+
 %09%09System.out
@@ -559,36 +559,33 @@
 %5B%5D %7B1, 2, 3%7D,%0A%09%09
-%09%09%09%09
+ 
    new int%5B%5D %7B7,
@@ -653,20 +653,17 @@
 , 3%7D,%0A%09%09
-%09%09%09%09
+ 
    new i
@@ -729,17 +729,18 @@
 %5D b) %7B%0A%09
-%09
+  
   return
@@ -797,9 +797,10 @@
 1%5D);%0A%09%7D%0A
-
 %7D
+%0A

Update CommonEndTest.java