I encountered this problem named MEX problem in Mercari, Inc / Software Engineer (New Graduate Position) Hiring Test 2022 and was not able to think of a possible approach to solve this problem
please shed some light on how to approach such type of questions

edit:
i am uploading other questions for your reference (P.S i was able to solve these)
question 2 (based on bit manipulation):


question 3 (based on simple anagram):

