-
Notifications
You must be signed in to change notification settings - Fork 20.8k
Closed
Description
Write a program that reads an array of ints and outputs the number of "triples" in the array.
A "triple" is three consecutive ints in increasing order differing by 1 (i.e. 3,4,5 is a triple, but 5,4,3 and 2,4,6 are not).
Sample Input:
6
1 2 4 5 6 7
Sample Output:
2
Sample Input:
6
1 4 7 5 4 3
Sample Output:
0
Metadata
Metadata
Assignees
Labels
No labels