Skip to content

Instantly share code, notes, and snippets.

@kharioki
Last active October 12, 2016 08:45
Show Gist options
  • Save kharioki/6e4faf8ce23bc21c4aff257da9aa4d51 to your computer and use it in GitHub Desktop.
Save kharioki/6e4faf8ce23bc21c4aff257da9aa4d51 to your computer and use it in GitHub Desktop.
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