Algorithm · Snowflake · Medium
You are given a list of node identifiers locations and a list of edges adjacencies that connect pairs of nodes. Determine whether you can assign each node one of three colors—"red", "blue", or "green"—so that no two nodes connected by an edge share the same color. Return true if such an assignment is possible, otherwise return false. Constraints: Every edge in adjacencies is bidirectional. There are no duplicate edges and no self-loops. Example (as reported) Example 1:…
Checking your access…