Due to scheduled maintenance, Codeforces may be unavailable starting from October 8, 20:00 (UTC) for a duration of 30 to 120 minutes. ×
Please read the new rule regarding the restriction on the use of AI tools. ×

dorasainath955's blog

By dorasainath955, history, 2 hours ago, In English

Submission this is the problem I'm trying to solve, my approach is to create a map that consists of each element and their frequency count, then for intial MEX i try to find elements less than MEX and such that x%(mp[i]-MEX)==0 and mp[i]>1. i try to convert that repeating element into MEX, if i couldn't I'll break out and print the MEX as answer, else I'll repeat the process until i reach size of array n. Where am i going wrong?

  • Vote: I like it
  • 0
  • Vote: I do not like it