isPatternAvoiding(w, pattern)
Given a permutation, checks if the permutation is pattern-avoiding, e.g. $2143$-avoiding or $1432$-avoiding. For example, a permutation $w$ is $2143$-avoiding if there does not exist indices $i < j < k < l$ such that $w_j < w_i < w_l < w_k$.
|
|
|
|
|
|
|
The object isPatternAvoiding is a method function.