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