Two words are defined as "Twin Words" of each other if they satisfy:-
1. Same number of consonants (letters which are not vowels like b,c x etc.) in both words.
2. Same set of consonants in both words
A phrase is said to be a “Twin Phrase” if all the words of a phrase are “Twin Words” of any word
in the other phrase
For example
1. BBC and BCC are Twin words as they have the same set of consonants - b and c; and
the same number of consonants - 3
2. Red and bread are not Twin words
Cover the following cases -
1. Write a program to check if two words are "Twin words" of each other
2. Write a program to take an input file of list of words (one word per line) and print out sets
of "Twin Words"
3. Now assume that input to previous question is a list of phrases instead of words. And a
phrase is said to be a "Twin Phrase" if all the words of a phrase are a "Twin Word" of any
word in another phrase. Write a program to print out sets of "Twin Phrases"
For eg. “Red BBC” and “Dear rad BCC” are twin phrases as every word in phrase 1 has
a twin word in phrase 2 and vice versa
Answers
Answered by
0
Answer:
I am not understanding anything
Similar questions
Hindi,
3 months ago
Math,
3 months ago
Math,
6 months ago
Social Sciences,
11 months ago
Social Sciences,
11 months ago
Science,
11 months ago