code: def _find_lcs(self, node, stringIdxs):
          
          nodes = [self._find_lcs(n, stringIdxs)
              for (n,_) in node.transition_links
              if n.generalized_idxs.issuperset(stringIdxs)]
  
          if nodes == []:
              return node
  
          deepestNode = max(nodes, key=lambda n: n.depth)
          return deepestNode
docs: Helper method that finds LCS by traversing the labeled GSD.