public static boolean check1DArrayHasAllNumbers(int[] elements,
			int boardSize) throws IllegalInput {

		int[] numCount = new int[boardSize];
		int expectedSum = boardSize * (boardSize + 1) / 2;

		if (elements.length != boardSize)
			throw new IllegalInput("Board Size is illegal");

		for (int i = 0; i < elements.length; i++) {
			int element = elements[i];

			// CHECK : Each entry should be in the range of 1 to n.
			if (element > boardSize || element < 1)
				throw new IllegalInput("out of range number present");
			
			// if a number has been repeated return right away, save some extra processing
			if(numCount[element - 1] != 0 )
				return false;
							
			numCount[element - 1] += 1;
			expectedSum -= element;			// subtracting from the total expected sum, at the end of the loop the sum should be 0
		}

		// CHECK : The row sum if not equal to n(n+1)/2 then the Sum Check Fails
		if (expectedSum != 0)
			return false;

		// CHECK : A Valid array should have each number once
		for (int i = 0; i < boardSize; i++) {
			if (numCount[i] != 1)
				return false;
		}
		return true;
	}