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’.
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’.