Dynamic Programming algorithm now uses int[][] rather than enum array