Open abhishekbhattacharyya opened 8 years ago
This answer will fail if the array has negative integers.
https://github.com/mission-peace/interview/blob/master/src/com/interview/array/CheckIfArrayElementsAreConsecutive.java#L19
int input[] = {-1,-2,-3,-4};
The solution assumes that the input array is positive. The assumption has been mentioned in the geeksforgeeks link.
Please assign this task to me ill do it.
This answer will fail if the array has negative integers.
https://github.com/mission-peace/interview/blob/master/src/com/interview/array/CheckIfArrayElementsAreConsecutive.java#L19
int input[] = {-1,-2,-3,-4};