Two Arrays
MediumRating 1600CodeforcesCombinatorics & Modular Arithmetic
Approach hintTry it first, then revealHide
Append the reverse of b to a: the pair becomes one non-decreasing sequence of length 2m with values in 1..n. Count those with stars and bars, C(n + 2m - 1, 2m).