Skip to content

Instantly share code, notes, and snippets.

@knugie knugie/solution.rb
Created Sep 2, 2018

Embed
What would you like to do?
How many 3 digit numbers have exactly 3 factors?
[*100..999].count{ |x| (1..x).count { |i| x % i == 0 } == 3 }
# => 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.