Implement a simplified grep command that returns lines matching a search target, along with their surrounding context lines.
Given an array of lines, a target string, and an integer linesAround, return all lines that should be included when searching for the target, along with up to linesAround lines before and after each match.
The matching uses case-sensitive substring matching. The search target can appear anywhere within a line, including as part of a larger word. For example, "Alex" matches in "Alexandra" but does not match "alex" or "ALEX".
Each line must appear at most once in the result, even if it falls within the context of multiple matches. The result must maintain the original document order.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected