text and a list of keywords keywords.
Wrap every occurrence of any keyword in text (occurrences may overlap) in <b> and </b> tags. To keep the markup clean, highlighted pieces that overlap or touch each other are merged under a single pair of tags.
Return text with the tags in place. Letter case matters.text='redcarandbluecar', keywords=['car', 'blue'] → 'red<b>car</b>and<b>bluecar</b>'
car occurs twice and blue once. The second car sits right after blue, so the two are wrapped in a single pair of tags.
text='aaaba', keywords=['aa', 'ab'] → '<b>aaab</b>a'
aa occurs at positions 0 and 1 (the hits overlap) and ab at position 2. Together they cover characters 0–3 as one block; the final a stays plain.
text='Report2024', keywords=['report', '2025'] → 'Report2024'
Case matters, and 2025 is not in the text, so nothing gets highlighted.
text and keywords[i] consist of English letters and digitstext='redcarandbluecar', keywords=['car', 'blue']
'red<b>car</b>and<b>bluecar</b>'
Run checks the first 3 tests in your browser. Submit checks all 110 tests on the server, hidden ones included.