Game theory -2 problem

what problem in my code
my code:-

Hi @Love

You were using an inefficient method to calculate factors, so instead you can use method of complexity(sqrt(n)) . Also while returning mex, you need to store that value in output[n].

Corrected Code for reference : https://ide.codingblocks.com/s/191654

Hope it Helps.