Help in a Leetcode String Problem

The question is here. I tried to solve it since a day but not able to find the logic. I was thinking in the direction of combinatorics. even the editorial does not explain anything. Could anyone explain this problem. @vijju123 I have always admired your editorials. Could you help me in this problem. Others too please help in this question. @taran_1407 @tmwilliamlin

On just looking at the problem I feel it uses DP similar to digit-dp. You might want to read some digit dp editorial like ENCODING

2 Likes

Ok I will go through it. Thank you.

The intended approach is Dynamic Programming and Digit DP and LPS function. Refer my code here, added comments for reference.

1 Like

The link for the code is not working @taran_1407.

Hi, Refer this link for Code.

3 Likes