Driver code
public static void Main ( string [ ] args ) { int [ ] arr = { 1 , 3 , 5 , 8 , 6 , 4 , 6 } ; int n = arr . Length ; int k = 2 ; Console . WriteLine ( " Count ▁ of ▁ pairs ▁ with ▁ given ▁ diff ▁ is ▁ " + countPairsWithDiffK ( arr , n , k ) ) ; } }