Problem · Graph

Drawing Edge

EasySnowflakeOA
See Snowflake hiring insights

Given a number of nodes, how many ways can a graph be drawn?

A network consists of multiple nodes. Each pair of distinct nodes can either be connected by an edge or remain disconnected. A node cannot be connected to itself. Determine the total number of distinct configurations of such a network. Since the result can be very large, return it modulo 10^9 + 7.

Examples
01 · Example 1
n = 3
return = 8

For n = 3 nodes, there are 8 possible configurations:

ABCABCABCABCABCABCABCABC

The function should return 8 because there are 8 possible configurations.

More Snowflake problems
drafts saved locally
public int drawingEdge(int n) {
  // write your code here
}
n3
expected8
sign in to submit