If seen was not given, then let seen be a new empty .
If seen contains input, then return invalid.
Jump to the appropriate step below:
If (input) is Number
For example, the value [10, 20, null, 30, 20]
is converted to an with subkeys 10, 20, 30.