# [Jelly], <s> 15 </s> 18 [bytes] +3 bytes to fix bugs in my method. QL×’$⁼L ŒPẎ€ÇÐfṪQL A monadic link taking the list of friendships (edges) and returning an integer. **[Try it online!][TIO-j6z9u4e5]** forms the power-set of the edges in memory so is inefficient both in space and time (yep,that's **O(2<sup>n</sup>)** folks)! ### How? QL×’$⁼L - Link 1, isClique?: list, flattenedEdges e.g. [1,3,2,3,3,4,4,1,4,2,2,1] ...from: [[1,3],[2,3],[3,4],[4,1],[4,2],[2,1]] Q - de-duplicate (gets unique ids) [1,3,2,4] L - length (get number of people involved) 4 $ - last two links as a monad: ’ - decrement 3 × - multiply 12 L - length (of flattenedEdges) 12 ⁼ - equal? 1 - (Note: the number of edges of a clique of size n is n*(n-1) and we're - guaranteed no repeated edges and that all edges are two distinct ids) ŒPẎ€ÇÐfṪQL - Link: list of lists, edges ŒP - power-set (all possible sets of edges (as lists)) Ẏ€ - tighten €ach (flattens each list of edges to a list of the ids) Ðf - filter keep those for which this is truthy: Ç - call last link (1) as a monad Ṫ - tail (get the rightmost, note that ŒP is ordered by length) Q - de-duplicate (get the unique ids) L - length (the number of friends in (one of the) largest clique(s)) [Jelly]: https://github.com/DennisMitchell/jelly [bytes]: https://github.com/DennisMitchell/jelly/Code-page [TIO-j6z9u4e5]: https://tio.run/##y0rNyan8/9/tyAKfR01rAn0e7u7iOjop4HD74QlpD3eu8vn//390tKGpjqGBuXGsTrSRsY65mQmEARUyNNIxMQfSJuY6hqYgPlAYrCgWAA "Jelly – Try It Online"