I would like to "complete" an array in MiniZinc as follows.
Say I have an array a=[A,H,J,D,C] which is associated to certain integers between 1 and 6 (injectively), e.g. n=[4,2,1,6,5] so here the 3 is missing. I would like to output the array a corresponding to an increasing ordering of n and filling in the missing element (3) by a fixed content, say XXX. In the example it would be
[A,H,XXX,J,D,C]
The way I considered for now is to create a new array of 6 variables, and checking for all of them if they are in a and assigning them at the right position, and putting XXX if the position do not appear. This makes my program terrible slower (about five times slower!).
Are there more efficient options to do so?