Algorithm · Snowflake · Medium
You are implementing a simplified version of the standard grep utility. Given a list of text lines, a string to search for, and a number specifying how many surrounding lines to include, return the subset of lines that would be shown when searching for that string. More precisely, you are provided with an array of strings lines, a search_target string, and an integer lines_around. For every line in lines that contains the search_target as a substring, include that matching…
Checking your access…