javascript implementation to count triplets in a sorted doubly linked list whose sum is equal to a given value ' x ' Represents node of a doubly linked list
class Node { constructor ( val ) { this . data = val ; this . prev = null ; this . next = null ; } }