private static int getC(Integer[] a, int count, int start, int[] values){
		int mindiff = Integer.MAX_VALUE;
		if (count == 1){
			int leftsum = 0;
			int rightsum = 0;
			for (int j = 0; j<a.length;j++){
				if (a[j] ==1)
					leftsum += values[j];
				else 
					rightsum += values[j];
			}
			for (int i = start; i<a.length; i++){
				if (a[i] != 1){
					leftsum += values[i];
					rightsum -= values[i];
					if (Math.abs(leftsum - rightsum) < mindiff)
						mindiff = Math.abs(leftsum - rightsum);
					leftsum -= values[i];
					rightsum += values[i];
					
				}
			}
			return mindiff;
		}
		
		for (int i = start; i<a.length; i++){
			if (a[i] != 1){
				a[i] = 1;
				int tempdiff = getC(a,count -1,i, values);
				if (tempdiff < mindiff)
					mindiff = tempdiff;
				a[i] = 0;
			}
		}
		
		return mindiff;
	}