I hereby claim:
- I am nbgoodall on github.
- I am nbgoodall (https://keybase.io/nbgoodall) on keybase.
- I have a public key ASDPpW2vo6a0QBY8H-vLFOBdtWNXIVWKV_5sHbs36Iarkwo
To claim this, I am signing this object:
class Player | |
def play_turn(warrior) | |
warrior.walk! | |
end | |
end |
# | |
# <Node tree=Array.new([value, left, right]) parent=Node node_index=(1|2)> | |
# | |
class Node < Struct.new(:tree, :parent, :node_index) | |
def value | |
@value ||= tree[0] | |
end | |
def leaf(index) | |
tree[index] ? Node.new(Array(tree[index]), self, index) : nil |
def missing_ints(arr) | |
(arr.min..arr.max).to_a - arr | |
end | |
missing_ints([1, 3, 3, 5, 6]) | |
# => [2, 4] | |
missing_ints([1, 2, 3, 4, 4, 7, 7]) | |
# => [5, 6] |
I hereby claim:
To claim this, I am signing this object: