Function to check if there is an element from each array such that sum of the three elements is equal to given sum .
bool findTriplet ( int a1 [ ] , int a2 [ ] , int a3 [ ] , int n1 , int n2 , int n3 , int sum ) {