Hacker News new | ask | show | jobs
by ajuc 1068 days 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.