function to count triplets in a sorted doubly linked list whose product is equal to a given value 'x
' NEW_LINE def countTriplets ( head , x ) : NEW_LINE INDENT ptr , ptr1 , ptr2 = None , None , None NEW_LINE count = 0 NEW_LINE DEDENT