Question: Write a C program that reads two strings S and T. Count the number of times that each character appears in both strings. Note First

Write a C program that reads two strings S and T. Count the number of times that each character appears in both strings.

Note

First output a string of distinct characters in both strings. Then, for each of those characters output the number of its occurrences in both strings.

Input Description:

String S

String T

Output Description:

In line 1, a string of distinct characters appears in S or T. (Sort these characters in ascending order according to their ASCII value).

From line 2, on each line is the number of a characters occurrences (according to the order in the string on line 1).

Example:

Input:

aabbaacc

Abbbcaa

Output:

abc

7

5

3

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 Databases Questions!