title: Getting the longest link in list of links in python
body: <p>I have a list of edges as follows:</p>
  
  <pre><code>edges_1 = ['a::b::c', 'a::b', 'a', 'a::d','a::d::e', 'a::d::e::f']
  edges_2 = ['a', 'b', 'c']
  </code></pre>
  
  <p>I am trying to write a function which return the longest links.. which for above cases will return</p>
  
  <pre><code>['a::b::c','a::d::e::f']
  </code></pre>
  
  <p>and for second case</p>
  
  <pre><code>['a', 'b', 'c']
  </code></pre>
  
  <p>My thoughts is using networkx and build a graph and then traverse the longest sequence.. but i was wondering if there is another data structure or approach I am missing which would solve this case.</p>