Condition to check if the Previous digit is equal to " * "
else if ( first == ' * ' ) { if ( second == ' * ' ) { dp [ i ] += 15 * dp [ i - 2 ] ; } else if ( second <= '6' ) dp [ i ] += 2 * dp [ i - 2 ] ; else dp [ i ] += dp [ i - 2 ] ; } } return dp [ n ] ; }