Your question is Search Character in Strings. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Amazon search tools may need to locate a character within a collection of product titles. Given an array of strings and a single target character, return the position of the target's first occurrence when scanning strings from left to right and characters from left to right.
Return the position as [string_index, character_index]. If the character does not appear, return [-1, -1]. The search is case-sensitive.
Implement find_character(strings, target).
strings is a list of strings.target is a string containing exactly one character.[i, j], where i identifies the string and j identifies the character position within that string.[-1, -1] when no match exists.def find_character(strings, target):