I am trying to understand the editorial of this question.
In the editorial it is written that,
“Iterate over the first digit and choose the one that appears as much to the right as possible. Then the same for the second digit, and so on. If any digit is not found in the string after the starting position of the check, then the password that starts with the chosen digits is strong.”
If I do the same with this example, s=1121134, m=2, l=11, r=12. Then I can only select 1 as the first digit, and I have to chose the right most occurrence of it(at index 5), now for the second digit I can chose 2, which is not found in the string after it(from 6 to 7 index). So password 12 should be strong, but it is present as sub string in s.
Please help me understand where I am going wrong.
I will be thankful for any help!