Created
September 2, 2018 20:47
-
-
Save knugie/b9a6dd1faf9fd6c3ade4e4022818ce2b to your computer and use it in GitHub Desktop.
How many 3 digit numbers have exactly 3 factors?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[*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