Created
October 4, 2016 13:37
-
-
Save RonanLOUARN/9ee8fafd6053075c53549fbf713e5e6b to your computer and use it in GitHub Desktop.
This file contains 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
return false if number.class != Fixnum | |
array = number.to_s | |
if array.size == 3 | |
array_checked = [array[0].to_i, array[1].to_i, array[2].to_i, array[0].to_i * array[1].to_i, array[1].to_i * array[2].to_i, array[0].to_i * array[1].to_i * array[2].to_i] | |
elsif array.size == 2 | |
array_checked = [array[0].to_i, array[1].to_i, array[0].to_i * array[1].to_i] | |
else | |
array_checked = [array[0].to_i] | |
end | |
if array_checked.uniq.size < array_checked.size | |
false | |
else | |
true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment