Randomize an array using constraints such that no number in the array repeats more than twice

In reply to dave_59:

Hello Sir,
Could you explain how this goto operator worked inside a constraint and what those last statements (conditions) mean?
Never seen such a constraint format before.
And using the second bracket {}, can we really use this parenthesis in case of loops in SV?

And one more thing. Could you tell me how to go with assertions? I have been on this topic for the past couple of weeks. Still, it feels like I know nothing whenever I see any tricky assertion-based interview question.