What the title says, I want to check if any two values in dictionary keys are the same. They can be in any two spots. For example if Key 0 = the same value as Key 3, 1, 2, 4, etc
Develop games in your browser. Powerful, performant & highly capable.
Brute force way would be to loop over all the keys, then loop over all the other keys and compare the values. But since you can’t do a double loop like that with one dictionary you’d want to copy the dictionary to another one first.
Dcopy: load dictionary.asJSON Dictionary: for each key Dcopy: for each key Compare: dictionary.currentKey<>dcopy.currentKey Compare: dictionary.currentValue=dcopy.currentValue — do something since there are duplicate values
That would let you handle it per duplicate value.