I need to check whether receipt numbers are consecutive and if not, what numbers are missing. I use a receipt book which has 80 receipt in it. Thus, the number runs from one to 80. In any given day, I could have receipts whose number ranges from, say, 15 to 55, or 73 through 80 to 23.
It is very easy for a human being to find out the first, last, and any missing receipt numbers. But how do I put it into a algorithm? I have been thinking about this for few days and still do not know where to start.
It is very easy for a human being to find out the first, last, and any missing receipt numbers. But how do I put it into a algorithm? I have been thinking about this for few days and still do not know where to start.