Wasif_Shahzad's blog

By Wasif_Shahzad, history, 4 weeks ago, In English

Can someone help me with the following problem?

We are given an integer $$$n$$$. There's an $$$ n \times n $$$ multiplication table as well.

We have to find the $$$MEX$$$ of the multiplication table. It can be easily solved in $$$ O({n}^2) $$$ but the constraints of the problem won't allow this. Therefore, can someone help me with an $$$ O(n) $$$ solution of this problem?

  • Vote: I like it
  • -1
  • Vote: I do not like it

»
4 weeks ago, # |
  Vote: I like it +21 Vote: I do not like it

I'm not sure but is it not just the next prime number?