I am writing the code to convert NFA to DFA, if we have a power state {1,2,4}, I have to convert it into the some unique number, say x. Also I have to do the reverse mapping such that is I get x, I have to return the power state as {1,2,4}
I came up with having HashMap of string representation of set 1,2,4 and having value as unique number. But as code grows, I might have (1,2,4) and (2,1,4) both are same set but not the same string. Then I thought of sorting the state string and using it as map key. But seems like my logic is complex.