Get Mystery Box with random crypto!

#N824. Goat Latin problem link #solution class Solution { | Leetcode in Java && MySQL

#N824. Goat Latin
problem link

#solution
class Solution {
public String toGoatLatin(String sentence) {
StringBuilder sb = new StringBuilder();
int count=1;
Set vowels = new HashSet<>(Arrays.asList('a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'));
for(String word: sentence.split(" ")){
if(vowels.contains(word.charAt(0)))
sb.append(word).append("ma");
else
sb.append(word.substring(1)).append(word.charAt(0)).append("ma");

for(int i=1; i<=count; i++)
sb.append("a");

count++;
sb.append(" ");
}

return sb.toString().trim();
}
}