Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def vowel_indices(word)
- vowels = %w[a e i o u y]
- answer = []
- word.downcase!
- word.each_char do |c|
- if vowels.include?(c)
- answer.push(word.index(c))
- end
- end
- #answer.uniq!
- answer.map! { |x| x + 1 }
- return answer
- end
Advertisement
Add Comment
Please, Sign In to add comment