Please read the new rule regarding the restriction on the use of AI tools. ×

TCS_Bhediya's blog

By TCS_Bhediya, history, 3 hours ago, In English

Problem Link
In this problem, I'm keeping track of some element greater than the current element is present in the suffix. I'm iterating the array, putting its element on the map, and tracking the maximum element. If the map size becomes (mx + 1), all the numbers from 0 to mx are present. Now, I can either append the mex of this array or move forward. I will move forward if some element greater than the mx element of the current mex array is present in the suffix. It's giving WA in test case 4, as it's appending an extra 4 mex (2 1 1 1), making its size 98 instead of 94. I'm wondering where the problem might be in my approach or implementation. 284266809

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