I have tried to solve the question in a rather simple and straight forward way by maintaining separate arrays for blocked and unblocked sites and then sorting them both so the blocked sites are displayed in lexicographical order, before applying the logic but it says WA. I have gone through a few discussions and all above mentioned test cases yield the expected output in my solution. I wish to post a question but don’t have the required karma points. I would be obliged to get an upvote or answer to the problem.
In the code:-
array check stores the last index value of all possible filters for that particular blocked site
array final stores the last index value of the final filter to be displayed,
array pos stores which blocked site it is
Sorry if its complicated
This is my solution