Skip to main content
1 of 5
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 15 bytes

FĠL€QLỊ
ŒPÇÐfṪL

A monadic link taking the list of friendships (edges) and returning an integer.

Try it online! forms the power-set of the edges in memory so is inefficient both in space and time (yep,that's O(2n) folks)!

Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282