Tap here to switch tabs
Problem
Submissions

Problem: Count Increasing Quadruplets

Try to solve the Count Increasing Quadruplets problem.

Statement

Given a 00 indexed integer array nums of length nn containing a permutation of numbers from 11 to nn, return the number of quadruplets (i, j, k, l) such that:

0≤0 \leq i < j < k < l < nn and nums[i] < nums[k] < nums[j] < nums[l].

Constraints:

  • 4≤4 \leq nums.length ≤4000\leq 4000

  • 1≤1 \leq nums[i] ≤\leq nums.length

  • All the integers of nums are unique. nums is a permutation.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Increasing Quadruplets

Try to solve the Count Increasing Quadruplets problem.

Statement

Given a 00 indexed integer array nums of length nn containing a permutation of numbers from 11 to nn, return the number of quadruplets (i, j, k, l) such that:

0≤0 \leq i < j < k < l < nn and nums[i] < nums[k] < nums[j] < nums[l].

Constraints:

  • 4≤4 \leq nums.length ≤4000\leq 4000

  • 1≤1 \leq nums[i] ≤\leq nums.length

  • All the integers of nums are unique. nums is a permutation.