// Arup Guha
// 8/15/2019
// Framework for 2018 AP FR Question #4: ArrayTester

import java.util.*;

public class ArrayTester {

	public static int[] getColumn(int[][] arr2D, int c) {
		// Fill in code here - will crash if you run without code.
		return null;
	}
	
	public static boolean hasAllValues(int[] arr1, int[] arr2) {
		
		// This just makes our task easier.
		HashSet<Integer> hs = new HashSet<Integer>();
		for (int x: arr2) hs.add(x);
		
		// Check each value in arr1 to see if it's in our hashset.
		for (int x: arr1) 
			if (!hs.contains(x))
				return false;
			
		// If we get here, we found everything in arr2.
		return true;
	}
	
	public static boolean containsDuplicates(int[] arr) {
		
		// Makes our life easier again.
		HashSet<Integer> hs = new HashSet<Integer>();
		
		// Go through each value.
		for (int x: arr) {
			
			// We added this one before...so we have a duplicate.
			if (hs.contains(x)) return true;
			hs.add(x);
		}
		
		// If we get here, we never had a duplicate.
		return false;
	}
	
	public static boolean isLatin(int[][] square) {
		// Fill in code here.
		return true;
	}
	
	public static void main(String[] args) {
		
		int[][] sq1 = {{1,2,3},{2,3,1},{3,1,2}};
		int[][] sq2 = {{10,30,20,0},{0,20,30,10},{30,0,10,20},{20,10,0,30}};
		int[][] sq3 = {{1,2,1},{2,1,1},{1,1,2}};
		int[][] sq4 = {{1,2,3},{3,1,2},{7,8,9}};
		int[][] sq5 = {{1,2},{1,2}};
		System.out.println(isLatin(sq1));
		System.out.println(isLatin(sq2));
		System.out.println(isLatin(sq3));
		System.out.println(isLatin(sq4));
		System.out.println(isLatin(sq5));
		
	}
}