Question: In java Assap String Pairs Possible Palindromes Consider a non-empty array inarr containing unique strings of lowercase alphabets. Identify and print, outnum, the number of

In java Assap  In java Assap String Pairs Possible Palindromes Consider a non-empty array
inarr containing unique strings of lowercase alphabets. Identify and print, outnum, the

String Pairs Possible Palindromes Consider a non-empty array inarr containing unique strings of lowercase alphabets. Identify and print, outnum, the number of unique pairs from inarr such that: All unique alphabets present in one string of the pair must be present in the other string of the pair however need not be vice versa If no such pair can be identified, print -1 Note: A string in inarr cannot be paired with itself. Input Format: Read the array inarr with the strings separated by "." (comma). Read the input from the standard input stream, Output Format: Print outnum or -1 accordingly. Print the output to the standard output stream Sample Input Sample Output Explanation similar ground, heaven h 2 In the given array, inarr Possible Palindromes String Pairs Sample Input Sample Output Explanation 2 similar ground, heaven, h ell, earth liar,shelf In the given array, inarr, below are the identified pairs that have the same set of unique alphabets present in both the strings Similar,liar hell shelf The number of unique identified pairs is 2 and hence the output -1 place kingdom, marriage relation,dockyard In the given array, inarr, no such pair can be identified. Hence, the output is 1 Languages. Java

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!