Last active
February 8, 2016 18:14
-
-
Save joelibaceta/4df8c92f96d1221d86ad to your computer and use it in GitHub Desktop.
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
def get_major_middle_min *numbers | |
(0..numbers.count-2).each |i| {numbers[i] > numbers[i+1] ? p i : } ... | |
# TODO | |
end |
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
def get_primes x | |
primes=[] | |
(2..x).each{ |n| primes.any?{|l| n%l==0 } ? nil : primes.push(n) } | |
return primes | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment