Given a list of strings, find any string that contains the complete value of at least one other list member as a contiguous substring. The two strings must come from different positions in the list. The returned string does not need to contain every other member. If no pair exists, return the language's empty result (None in Python, null in Java, JavaScript, and C#, or std::nullopt in C++).
For ["frontend", "end"], the finder returns "frontend" because its final three characters form the complete string "end".
For ["programming", "am", "pro"], the finder returns "programming" because it contains both "am" and "pro".
For ["cat", "dog", "bird"], no string contains another list member, so the finder returns the language's empty result.
A position cannot match itself. Equal strings at different positions do form a valid containment pair, and when several answers qualify, you may return any one of them.
Implement the brute-force finder declared in the starter code. Return any string that contains another list member from a different position, or the language's empty result if no containment pair exists.
Rules:
- every string is non-empty,
- a string never counts as containing itself (same position),
- two identical strings at different positions do contain each other,
- matching is case-sensitive,
- if several strings qualify, returning any one of them is acceptable.
For input ["programming", "am", "pro"], the finder returns "programming".
AI assistance is disabled for this part. Explain the time and extra-space complexity before you implement the finder.
test_returns_container_for_example
test_returns_none_when_no_pair_exists
test_single_string_returns_none
test_duplicates_count_as_containment
test_is_case_sensitive
test_returns_a_valid_container_on_mixed_list