4 ms·
before picking up apple table = {apple0, apple1, apple2, apple3}; //length == 4 hand = {}; //length == 0 after table = {apple0, apple1, apple2};
by ajuc 3y ago
before picking up apple
table = {apple0, apple1, apple2, apple3}; //length == 4
hand = {}; //length == 0
after
table = {apple0, apple1, apple2}; length == 3
hand = {apple3}; //length == 1
You count apples in hand by looking at how many items there are, not by what indexes they have.