Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Progress Medium In a laboratory, there are various chemicals, and each chemical is represented by a symbol such as H , B , C

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 chermical 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 symbolalong with the number of times it is added continuously. Join different chemical symbols using the plus 1+1 as shown in the sample output.
If a chemical is added only once without any repetition, print the chemical name without its count.
Ex: "HHCOO" "H2+C+O2"
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions

Question

Explain opportunity costs and diminishing returns.

Answered: 1 week ago

Question

5. Identify three characteristics of the dialectical approach.

Answered: 1 week ago