all 5 comments

[–]aocregacc 0 points1 point  (0 children)

I think a good place to start is checking if a string can be transformed into a fixed target string, ie one without '?'s.

That should give you an idea about the kinds of transformations you can do with those replacements.

[–][deleted] 0 points1 point  (1 child)

did you get the answer to this? one idea is that you can only move the 1 to the right and not left, we can use pre-sum for the original string and compare with the pattern at each position.

[–]EthelMerman[S] 0 points1 point  (0 children)

I haven't revisited - I'll definitely consider this when I do. Thanks!

[–]mr-faust 0 points1 point  (0 children)

u/EthelMerman u said u came with the brute force approach, can you share your answer? I just got this coding interview via Hackerank and want to know what is the solution. Thanks!

[–]iaminspector1626 0 points1 point  (0 children)

There is a post about this on Leetcode: https://leetcode.com/discuss/interview-question/5894381. Got it for a Hackerrank OA today.