Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
def with_payload(template, payload, used = nil)
|
||||
template.map do |item|
|
||||
if item.is_a? Enumerable
|
||||
with_payload(item, payload, used)
|
||||
else
|
||||
used << item
|
||||
payload[item]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
p = {"Payload#0", "Payload#1", "Payload#2", "Payload#3", "Payload#4", "Payload#5", "Payload#6"}
|
||||
t = { { {1, 2}, {3, 4, 1}, 5}}
|
||||
used = Set(Int32).new
|
||||
puts with_payload(t, p, used)
|
||||
|
||||
unused = Set(Int32).new((0..6).to_a) - used
|
||||
puts "Unused indices: #{unused}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue