Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя TCS_Bhediya

Автор TCS_Bhediya, история, 5 часов назад, По-английски

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

  • Проголосовать: нравится
  • -1
  • Проголосовать: не нравится