Search
⌘K

Leetcode 2179. Count Good Triplets in an Array

Count the number of value triplets (x,y,z) in two permutations of 0..n−1 such that the indices of x,y,z are strictly increasing in both arrays (they form a common increasing subsequence of length three). With n up to 1e5, you need an efficient sub-quadratic counting approach rather than brute-force enumeration.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.