How do I speed up java solution to SPOJ HACKRNDM

This post was flagged by the community and is temporarily hidden.

Try making algorithmic changes. It would become easy once the element are sorted. After that you can run a binary search on ‘element+2’.