Count the productive teams of size 4 in a permutation of levels.
Unlock detailed company stats for this questionUpgrade
Given a permutation level[] of size n (values 1 to n), count the teams (x, y, z, w) such that x < y < z < w, level[x] < level[z] and level[y] > level[w]. Example: level = [11, 14, 12, 13, 15] gives 1. Constraint: 4 <= n <= 3000.
Community answers
No answers contributed by the community yet.
Related courses

Course

Course
Course
