Closed lukegrecki closed 5 years ago
def first_wa(array) wa_arr = [] array.each do |item| if item[0..1] == ("wa") wa_arr << item end end
wa_arr.first
end
Hi @lukegrecki,
Thank you for spotting this and opening an issue. We've updated this lesson and incorporated changes based on you feedback, updating the tests and solution so that they align with the test message. The previous solution will no longer work, but your example solution still will.
Thank you for contributing to a Learn lesson!
The solution given also returns words with a "wa" anywhere in the string. Here's my solution:
This solution only matches "wa" at the start of the string.