public static int findTallest(Collection<Box> boxes){
		ArrayList<Box> rotations = new ArrayList<Box>();
		int maxHeight[] = new int[rotations.size()];
		for(Box b : boxes){
			rotations.add(b);
			rotations.add(new Box(Math.max(b.height,b.width),Math.min(b.height,b.width),b.length));
			rotations.add(new Box(Math.max(b.height,b.length),Math.min(b.height,b.length),b.width));
		}
		/*
		 * sort all the rotations based on the base area
		 */
		Collections.sort(rotations);
		
		/*
		 * Dynamically find the tallest building got by placing each box rotation at the top
		 */
		for(int i = 0;i < rotations.size();i++){
			Box a = rotations.get(i);
			for(int j = 0;j < i;j++){
				Box b = rotations.get(j); 
				if((b.width > a.width) && 
						(b.length > a.length) &&
						(maxHeight[j] + a.height > maxHeight[i])){
					maxHeight[i] = maxHeight[j] + a.height;
				}
			}
		}
		/*
		 * get the maximum of the height after scanning the entire array
		 */
		int max = 0;
		for(int i : maxHeight){
			if(i > max){
				max = i;
			}
		}
		return max;
	}