How would you solve this question?
Anonymous User
1296

Given a string and a style array render HTML pretty much like a rich text editor.

For example: 'Hello, world', [[0, 2, 'i'], [4, 9, 'b'], [7, 10, 'u']]
Output: '<i>Hel</i>l<b>o, w<u>orl</u></b><u>d</u>'

Keep in mind that <u> tag gets placed before the <b> tag and after it as the insertion index overlaps it.

Comments (7)