Pregunta de entrevista de IBM iX

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