1. You will be given a string str and an array of strings dict
2. You need to encapsulate all such substrings in str that appear in array dict within a bold tag, <b>substring</b>
3. If two substrings overlap, you need to wrap them together by only one pair of closed bold tag, that is if 'ab' is in dict and 'bc' is also in dict, encapsulate 'abc' in string not 'ab' and 'bc' separately.
4. Also, if two substrings wrapped by bold tags are consecutive, you need to combine them.
5. Input and output is handled for you
6. It is a functional problem ,please do not modify main()
Input Format
Input is handled for you.
Output Format
Output handled
Constraints
The given array, dict won't contain duplicates, and its length won't exceed 100 String length in range [1, 1000]
Notice
Try First, Check Solution later
1. You should first read the question and watch the question video.2. Think of a solution approach, then try and submit the question on editor tab.3. We strongly advise you to watch the solution video for prescribed approach.Example
Input
delhi110092 3 delhi 92 hi
Output
<b>delhi</b>1100<b>92</b>