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

Автор adaptatron, 5 недель назад, По-английски

Given a permutation, compute the unique MEX across all subarrays. Then, reverse the problem, given a binary string where a $$$1$$$ at index $$$i$$$ means that a subarray with MEX $$$i$$$ exists (and $$$0$$$ means it doesn't), compute the number of permutations that satisfy these constraints.

I created a video discussing the ideas to solve both the problem in $$$O(N)$$$. Practice Problem

Video https://youtu.be/78N9JfaQ72g

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