Driver code
public static void Main ( ) { int k = 2 ; int [ ] arr = { 2 , 4 , 1 , 3 , 1 } ; int n = arr . Length ; Console . WriteLine ( " Total ▁ pairs ▁ for ▁ k ▁ = ▁ " + k + " ▁ are ▁ " + countPairsWithKDiff ( arr , n , k ) + " STRNEWLINE " ) ; } }