cswork / OA打开练习工作台

CiscoOA #26

Find Words in Grid

估计简单可在线判题

考点(AI 标注)字符串

For each word, independently determine whether it appears as a contiguous segment of some row or some column of the grid, read either forward or backward. It cannot turn or go diagonally, and matching is case-sensitive.

输入格式

The input is a JSON array [gridRows,words]. The original had no numeric bounds; this site adds 1≤number of rows, number of columns≤200, with all rows of equal length in Unicode code points; 0≤number of words≤200, each word 1..200 code points, and total word length ≤40000. Characters are arbitrary Unicode scalar values, including whitespace, NUL, and non-BMP characters; lone surrogates are not allowed. The whole JSON is ≤1000000 UTF-8 bytes, and the generator uses ASCII escapes so that control characters are carried intact.

输出格式

Output Yes or No for each query in order, separated by spaces or newlines; if there are no queries, output an empty line.

样例 1

输入:

[["abc","def"],["cba","ad","ae"]]

输出:

Yes Yes No

样例 2

输入:

[["A a"],["A","a"," "]]

输出:

Yes Yes Yes

样例 3

输入:

[["\ud83d\ude00\u0000"],[]]

输出:

样例说明

The outputs of the three public examples are, in order: Yes Yes No; Yes Yes Yes; empty text. Verified by independent enumeration or direct simulation.