Company: UiPath
Difficulty: medium
Word Matching by Swaps and Block Increments Two strings `a` and `b` are considered **matching** when `a` can be turned into `b` by the following process. First, choose a single integer `k` with `k > 1`. This `k` is fixed for the whole conversion. Then apply either of the two operations below, in any order, any number of times (including zero times): **Operation Type 1** — pick any index `i` with `1 <= i < length(a)` and swap the characters `a[i]` and `a[i+1]` (indices here are 1-based). **Operation Type 2** — pick a substring of `a` of length exactly `k` whose characters are all the same, and replace every character of that substring by the next letter of the alphabet. For example a substring `"aa"` becomes `"bb"`. A substring made of the letter `z` can never be incremented, so Operation Type 2 may not be applied to it. You are given two arrays of strings, `words1` and `words2`, each containing `n` strings. For every index `i`, decide whether `words1[i]` an