Question: I need this solved in ruby Ruby 2. starts with 1 > hef starts 3 end -- 5 > p starts_wi Write a method starts
Ruby 2. starts with 1 > hef starts 3 end -- 5 > p starts_wi Write a method starts with that accepts an array of words and a letter The method should return an array containing the words that begin with the given letter. Nm starts with(["apple", "bacon", "aspara gus", "artichoke", "carrot", "broccoli "], "a") # => ["apple", "asparagus", "artichoke starts_with(["apple", "bacon", "aspara gus", "carrot", "broccoli"], "b") # => ["bacon", "broccoli") starts with(["apple", "bacon", "aspara gus", "carrot", "broccoli"], "z") # => [] starts with(["yellow", "red", "rebecca purple"], "") # => ["red", "rebecca purple"] Rules: 1. Edit your code below and use the Run Code button to check the output. Do not use repl.it. Once the tests pass, your code for this question is good, and you can move on. 2. Your final code submission must not use any print statements. You may use them to help debug, but if you forget to remove them, they will cause your code to fail Test Results Custo
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
