Number of tuples, given the relative order??

Правка en1, от fake_id_123, 2021-01-24 16:31:26

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.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский fake_id_123 2021-01-24 16:31:26 400 Initial revision (published)