public static int decimalPeriod(int denom, int numerator) {
        boolean[] remaindersHit = new boolean[denom];
        int[] remaindersPos = new int[denom];
        
        for (int i = 0; i < denom; i ++) {
            numerator = numerator%denom;
            if (numerator == 0) {
                break;
            } else if (remaindersHit[numerator] == true) {
                return i - remaindersPos[numerator];
            }
            remaindersHit[numerator] = true;
            remaindersPos[numerator] = i;
            numerator *= 10;
        }
        
        return 0;
    }