Computer Science, asked by kaiswarya9797, 1 month ago

write a javaprogram to enter array of strings . And display how many total strings are there , also length of each of the strings .

Answers

Answered by lawriyona
0

Answer:

Input: string = [“mouse”, “me”, “bat”, “lion”], chars = “eusamotb”

Output: 10

Explanation:

The strings that can be formed using the characters “eusamotb” are “mouse” and “me” and “bat”.

Length of “mouse” is 5, length of “me” is 2, and length of “bat” is 3

Sum of all lengths = 5 + 2 + 3 = 10.

Input: string = [“hi”, “data”, “geeksforgeeks”], chars = “tiadha”

Output: 6

Explanation:

The strings that can be formed using the characters “tiadha” are “hi” and “data”. Where length of “hi” is 2, length of “data” is 4, the sum of all is 2 + 4 = 6.

Similar questions