function to count triplets in a sorted doubly linked list whose product is equal to a given value ' x '
int countTriplets ( struct Node * head , int x ) { struct Node * ptr1 , * ptr2 , * ptr3 ; int count = 0 ;