Common Prefix will be updated with Dynamic Programming