Since array have duplicate numbers, so we can only use each element once, we need to make sure we dont have repeated combination multiple times
candidate = [1, 1, 2], target = 3
Without skipping duplicate result could be
[1,2] (from first 1)
[1,2] (from second 1) ← duplicate!
We only want one [1,2].
so by sorting array duplicate numbers are next to each other, so it makes easier to skip them by using below condition
if (i > index && candidates[i] == candidates[i - 1]) continue;