IBM iX interview question

Leetcode question asking to find the MEX given an additional x parameter