Driver method to test the above function
public static void main ( String [ ] args ) { int sum = 6 ; System . out . println ( " Count ▁ of ▁ pairs ▁ is ▁ " + getPairsCount ( arr . length , sum ) ) ; } }