Last active
October 12, 2016 08:45
-
-
Save kharioki/6e4faf8ce23bc21c4aff257da9aa4d51 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
a = [[1,2,4,5],[6,7,8,9],[10,11,12,13],[14,15,16,17]] | |
number = 17 | |
def box_arr_num(a, number) | |
length = a.length-1 | |
number = number | |
(0..a.length).each do |i| | |
if a[i][a.length-1] >= number | |
(0..a.length).each do |j| | |
if a[i][j] == number | |
return i, j | |
end | |
end | |
end | |
end | |
end | |
print box_arr_num(a, number) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment