Skip to content

Instantly share code, notes, and snippets.

@oleglukashev
Created April 26, 2015 14:57
Show Gist options
  • Save oleglukashev/2abe22ea8884e1af9ba8 to your computer and use it in GitHub Desktop.
Save oleglukashev/2abe22ea8884e1af9ba8 to your computer and use it in GitHub Desktop.
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