Interview Query

Append Frequency

Start Timer

0:00:00

Upvote
5
Downvote
Save question
Mark as completed
View comments (13)
Next question

Given a string sentence, return the same string with an addendum after each character of the number of occurrences a character appeared in the sentence.

Note: don’t treat the spaces " " as characters. Also; do not return the addendum for those characters that also appear in the discard_list.

Example:

Input:

sentence = "Interview Query"

discard_list = ['I','e']

Output:

inject_frequency(sentence, discard_list) -> "In1t1er2v1i1ew1 Q1u1er2y1"
.
.
.
.
.


Comments

Loading comments