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

Автор fake_id_123, история, 3 года назад, По-английски

Given an array which is also an permutation.
How many tuples are there such that

$$$ i < j < k < l$$$ and $$$ a_i < a_k < a_j < a_l $$$

Another variation was

$$$ i < j < k < l < m $$$ and $$$ a_i < a_k < a_j < a_m < a_l $$$

P.S., this was interview question so no constraints were given, what is best complexity can we achieve.

Полный текст и комментарии »

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