Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Greedily try to add one missing character. How to check if adding some character will not cause problems ? Use bit-masks to check whether you will be able to complete the sub-sequence if you add the character at some index i.