(String word)
| 21 | } |
| 22 | |
| 23 | public int isVowel(String word){ |
| 24 | HashSet<Character> set = new HashSet<>(Arrays.asList('a','e','i','o','u')); |
| 25 | char first = word.charAt(0); |
| 26 | char last = word.charAt(word.length()-1); |
| 27 | if(set.contains(first) && set.contains(last)){ |
| 28 | return 1; |
| 29 | } |
| 30 | return 0; |
| 31 | } |
| 32 | } |