0
The input array that you have is:
0, 3, 3, 7, 5, 3, 11, 1
Imagine that the array instead would be this:
0, 1, 3, 3, 3, 5, 7, 11
If the array were organized like that, then you could loop through the array and more easily count pairs.
0 --> 1
1 --> 3, 3, 3
3 --> 3, 3, 5
3 --> 3, 5
3 --> 5
5 --