Compare the rule with concrete cases
Fictional search requires A immediately followed by B. A,B matches; A,X,B does not. An alternative ordered-subsequence rule would allow the middle X. Both rules preserve order, so saying “find A before B” is insufficient for the consecutive requirement.
| Sequence | Adjacent A,B | A-before-B subsequence | Why |
|---|---|---|---|
| A,B | Yes | Yes | No intervening item |
| A,X,B | No | Yes | X interrupts adjacency |
| B,A | No | No | Order reversed |
Work through the distinction
The intervening X distinguishes adjacency from order alone. Surrounding X items distinguish matching a portion from requiring whole-sequence equality. Include both contrasts in the cases.
Does X,A,B,X match the original consecutive rule?
Show the worked answer
Yes. Its middle A,B are adjacent. The rule does not require the whole sequence to equal only A,B.
Acceptance wording to adapt
Return a match when some adjacent pair of positions contains A then B. Allow other items before or after that pair. Reject A,X,B as a match for this pattern.