public int minLevel(int[] heights) {
		int diff = 0;
		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		for (int i = 0; i < heights.length; i++) {
			if (i > 0 && diff > heights[i] - heights[i-1]) {
				diff = heights[i] - heights[i-1];
			}
			if (min > heights[i]) {
				min = heights[i];
			}
			if (max < heights[i]) {
				max = heights[i];
			}
		}
		if (max-min<heights.length){
			return heights.length-1;
		}
		return -diff-1;
	}