private static int convertSpanToSparseGrid(int curIx, int span, TreeSet<Integer> indexes)
	{
		int lastIx = curIx + span;
		int retSpan = 1;

		for (Integer ix : indexes) {
			if (ix <= curIx)
				continue;   // We have not arrived to the correct index yet

			if (ix >= lastIx)
				break;

			retSpan++;
		}
		return retSpan;
	}