AlgoMaster Logo

Set Mismatch

nums=[1, 2, 2, 4]
0 / 15
01231224duplicate = ?missing = ?
algomaster.io
Step:nums holds 1..4 with one number duplicated and one missing. Pass 1 marks value v as seen by negating nums[v-1]