-2

I am working on a project where I need to assign some people with an unique ID.

Now I have this requirement that, based on those IDs, I need to generate a set of unique numbers. No two IDs should result in the same set, and the intersection of sets from any two IDs should be empty.

How am I supposed to achieve this? Suggest an algorithm for this.

Tamal Das
  • 9
  • 2

1 Answers1

0

Concatenete the unique ID and a unique serial number.

Depending on the situation, the serial number can be global, or can be assigned per ID.

E.g.

A1, B2, A3, C4, E5, A6, A7, B8...

vs.

A1, B1, A2, C1, E1, A3, A4, B2...