How to solve this?

Find the maximum number of pairs we can form such that the difference of pair is not less than k.

Ex : n= 6,k=3;
[1,4,7,10,13,15]
here is my approach :slight_smile:


output :3