Add a code block to calculate the efficiency of the bottom-up method.