Write a method sameVowelsStrings that takes three Strings as input. The method returns true if the three Strings contains the same unique vowels, false otherwise. Note that vowels are 'a', 'e', 'i', 'o' and 'u'
Write a method sameVowelsStrings that takes three Strings as input. The method returns true if the three Strings contains the same unique vowels, false otherwise. Note that vowels are 'a', 'e', 'i', 'o' and 'u'.
For example:
• sameVowelsString("apple", "cattle", "accept") returns true. All strings have a and e as their vowels.
• sameVowelsStrings("apple", "banana", "assume") returns false. The second string is missing the vowel e.
The first and second strings are missing the vowel u
• sameVowelsStrings("apple", "orange", "recordable" ) returns false. The first string is missing the vowel o.
• sameVowelsStrings("e", "ee", "eee" ) returns true. They all have vowel e.
Subject: Java
Trending now
This is a popular solution!
Step by step
Solved in 2 steps