Drawing Edge
Problem statement
A network has n distinct nodes. Every pair of different nodes can either have one undirected edge or remain disconnected; self-edges are not allowed.
Return the number of distinct network configurations modulo 10^9 + 7.
Function
drawingEdge(n: int) → intExamples
Example 1
n = 3return = 8For three nodes A, B, and C, the possible edges are AB, AC, and BC. The eight configurations are:
- no edges
- only
AB - only
AC - only
BC ABandACABandBCACandBC- all three edges
Each of the three edges has two independent states, so there are 2^3 = 8 configurations.