Function to find consecutive integers in a given array