docs: private static int decodeDigit(int[] counters) throws NotFoundException {
      float bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
      int bestMatch = -1;
      int max = PATTERNS.length;
      for (int i = 0; i < max; i++) {
        int[] pattern = PATTERNS[i];
        float variance = patternMatchVariance(counters, pattern, MAX_INDIVIDUAL_VARIANCE);
        if (variance < bestVariance) {
          bestVariance = variance;
          bestMatch = i;
        } else if (variance == bestVariance) {
          // if we find a second 'best match' with the same variance, we can not reliably report to have a suitable match
          bestMatch = -1;
        }
      }
      if (bestMatch >= 0) {
        return bestMatch % 10;
      } else {
        throw NotFoundException.getNotFoundInstance();
      }
    }