Constraints for a queue/array: Need help to understand how to implement this #3 condition

In reply to ABD_91:

Hi ABD_91, Thanks, Yes I thought about it, But still real problem is with #3 implementation. I still can’t figure out a way to implement that constraint or any other way like in post-randomization/ late-randomization.
Let me edit Title & Post to avoid confusion.