Save 25%Black Friday: 25% off all plans — use code BLACKFRIDAY2026 at checkout. Ends Monday, Dec 7.Claim the deal

Given a string s consisting of multiple words separated by spaces, and a list of strings elements, identify the first substring in each word of s that matches any string in elements. Once a match is found, wrap the substring in square brackets "[ ]".

Test Cases
Input
Output
Expected