Skip to content

Conversation

@matthewlee07
Copy link

Is there a shorter way of doing fetch_CD_animals?


def fetch_CD_animals(input)
#implement your solution here
input.find_all {|animal|animal[0]=="c" || animal[0]=="d"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See if String#start_with? simplifies this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants