Question: INSTRUCTIONS Description MEDIUM In Progress Medium In a laboratory, there are various chemicals, and each chemical is represented by a symbol such as H ,

INSTRUCTIONS
Description
MEDIUM
In Progress
Medium
In a laboratory, there are various chemicals, and each chemical is represented by a symbol such as H,B,C,O,F, etc. A student has added chemicals to a jar one by one. He wants to know the chemical mixture that he created using the chemicals.
Given a string of chemical symbols that represent the order in which the student added the chemicals to the jar. Write a program to print a string with each chemical symbol along with the number of times it is added continuously. Join different chemicat symbols using the plus (+) as shown in the sample output.
If a chemical is added only once without any repetition, print the chemical name without its count.
(
INSTRUCTIONS Description MEDIUM In Progress

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!