IBM iX Interview Question

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