A node class which stores the color and the edges connected to the node
public int color = 1 ; public HashSet < int > edges = new HashSet < int > ( ) ; } ; static int canPaint ( List < node > nodes , int n , int m ) {