
" is the code used for quotation marks symbol: (“)
' is the code used for single quotation marks or apostrophe symbol: (‘)
< is the code used for less than symbol: (<)
> is the code used for greater than symbol: (>)
& is the code used for the ampersand symbol: (&)
/ is the code used for the slash symbol: (/)
\ is the code used for the backslash symbol: (\)
“STR”: " Coding Ninjas is a platform to practice coding & participate in events. "
Which on converting will look like: “Coding Ninjas is a platform to practice coding & participate in events.”
The first line contains an integer ‘T’, which denotes the number of test cases or queries to be run. Then the test cases are as follows.
The first and the only line of each test case contains the string 'STR'.
For each test case, print the converted sentence.
Print the output of each test case in a separate line.
You don’t need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 5
1 <= |STR| <= 10^5
String STR contains only lowercase letters.
Where ‘|STR|’, denotes the size of the string 'STR'.
Time limit: 1 sec
The basic idea is to traverse the given string and find if the given string contains HTML entities. If any entity is found, convert it to its corresponding single character.
Algorithm