This question evaluates proficiency with string algorithms and pattern matching, assessing understanding of substring search complexity and algorithm selection within the algorithms and data structures domain, and is commonly asked to verify efficient low-level text-search implementation and time/space trade-off reasoning at a practical implementation level. The "Dash Mart" grid BFS evaluates graph traversal, state-space modeling, and shortest-path reasoning for multi-target collection tasks within graph algorithms and path-finding, and is commonly asked to measure competence in BFS-based search, state encoding and optimization strategies with a focus on practical algorithmic application and performance considerations.

Implement a string-matching function that returns the first index of a pattern in a text (akin to LeetCode 28 Implement strStr()). 2) “Dash Mart” grid path-finding: given a 2-D map with a start cell, obstacles, and target pickup cells, code a BFS to find the minimum steps to collect all required items and explain follow-up optimizations.