Skip to content

Conversation

zeitschlag
Copy link
Owner

No description provided.

@zeitschlag zeitschlag changed the title Add solution for 4.1 Add solution for day 4 Dec 4, 2019

potential_passwords = []

(353096..843212).each { |current_number|
Copy link

Choose a reason for hiding this comment

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

Instead of each and then appending to the array, use map, which returns an array. The block should return the input number, if it's a potential password, and nil otherwise. Then put a .compact on the resulting array.

@zeitschlag zeitschlag merged commit 637cc57 into master Dec 8, 2019
@zeitschlag zeitschlag deleted the 04 branch December 8, 2019 10:42
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