After pre-processing, instead of using FingerPrint, use int array directly for query.
Replace HashSet with integer array.
Avoid unnecessary splitting start and end number in inner loop. Got 9/10 TLE. This solution won't work because the number of test cases is increased from 6 to 10000 after migrating to hacker rank.