File tree 1 file changed +0
-27
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +0
-27
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 616. Add Bold Tag in String
5
- *
6
- * Given a string s and a list of strings dict,
7
- * you need to add a closed pair of bold tag <b> and </b>
8
- * to wrap the substrings in s that exist in dict.
9
- * If two such substrings overlap, you need to wrap them together by only one pair of closed bold tag.
10
- * Also, if two substrings wrapped by bold tags are consecutive, you need to combine them.
11
-
12
- Example 1:
13
- Input:
14
- s = "abcxyz123"
15
- dict = ["abc","123"]
16
- Output:
17
- "<b>abc</b>xyz<b>123</b>"
18
-
19
- Example 2:
20
- Input:
21
- s = "aaabbcc"
22
- dict = ["aaa","aab","bc"]
23
- Output:
24
- "<b>aaabbc</b>c"
25
-
26
- Note:
27
- The given dict won't contain duplicates, and its length won't exceed 100.
28
- All the strings in input have length in range [1, 1000].
29
- */
30
3
public class _616 {
31
4
32
5
public static class Solution1 {
You can’t perform that action at this time.
0 commit comments