Solve the grouping phone number digits with best quality problem with DP.