public static int minPathSum(int[][] grid) {
		
		int[][] cache = new int[grid.length][grid[0].length];
		cache[0][0] = grid[0][0];
		
		for(int i = 1; i < grid.length; i++) {
			cache[i][0] = cache[i-1][0] + grid[i][0];
		}
		for(int i = 1; i < grid[0].length; i++ ) {
			cache[0][i] = cache[0][i-1] + grid[0][i];
		}
		for(int i = 1; i < grid.length; i++) {
			for(int j = 1; j < grid[0].length; j++) {
				cache[i][j] = Math.min(cache[i-1][j], cache[i][j-1]) + grid[i][j];
			}
		}
		print(cache);
		return cache[cache.length - 1][cache[0].length - 1];
	}