Created
April 26, 2015 14:57
-
-
Save oleglukashev/2abe22ea8884e1af9ba8 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 solution(array) | |
filtered_array = array.select{|item| item >= 0} | |
filtered_array.each do |first| | |
filtered_array.each do |second| | |
unless second == first | |
filtered_array.each do |third| | |
if third != first && third != second | |
if first + second > third && | |
first + third > second && | |
second + third > first | |
return 1 | |
end | |
end | |
end | |
end | |
end | |
end | |
0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment