I'm looking for an "efficient" way to persist a binary state when given to two integers. Giving these two integers A an B, A is always less than B and the range of values which they will contain is 0 through N. The integer N will be greater than 2 and less than 256.
The simple solution is to create a two-dimensional array of Boolean values, but that leaves more than half of the array unused because there are unused values when B is less than or equal to A.
Does anyone know of a way to use less memory and still be "fast?"