Checking if a list of strings can be chained

后端 未结 8 774
庸人自扰
庸人自扰 2021-01-31 23:45

Question

Implement a function bool chainable(vector v), which takes a set of strings as parameters and returns true if they

8条回答
  •  孤街浪徒
    2021-01-31 23:56

    This can be solved by a reduction to the Eulerian path problem by considering a digraph G with N(G) = Σ and E(G) = a->e for words aWe.

提交回复
热议问题