When you write down your formula to populate the array entries, make sure that on the right-hand side, whenever you do an array lookup, that is indeed already computed and available for constant time lookup. 