Difficult# Consecutive Numbers in Array of Integers

APCSA-NYDYGN

The **numbers** array contains an array of increasing integers.

Which of the following methods will take this array as its parameter and return the number of groups of consecutive integers?

For example, if the numbers array contains {3, 9, 10, 11, 15, 17, 18, 20, 21, 22, 25}, then the method should return 3, since there are three groups of consecutive integers: first group is 9, 10, 11, second group is 17, 18, and third group is 20, 21, 22.