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