Combining 2 numbers into a uniqe number

74 Views Asked by At

I am stumped on a problem, I have a set of numbers (lets say 2 numbers) A and B and i want to combine them into a unique number C where C is not reproducible by any other set thats not identical ([2,1] and [1,2] would be considered identical)

I don't know if it's possible but i have a inkling that it should be.

Why? Its not an assignment, but I'm looking into combining several pieces of information into one unique piece (I'm planning on using it to flatten an array of data).

Example: { {2,1,4}, {2,2}, {1,4} }

is to be converted into something like {1,2,3}

Of course i could iterate the first set and see what sub arrays are identical and index them like that, but that feels heavier that i would wish for.