Split an array equally and unique

module top;
  class A;
     int array[] = {1,2,3,4,5,6,2,4,5,7}; // Here 3 numbers are repeated (2,4,5)
     rand int arr1[], arr2[];
     constraint c {
		   arr1.size() == array.size/2;
		   arr2.size() == array.size/2;
		   foreach(array[i]) 
		   if (array.sum() with (int'(item == array[i])) == 2 ) {
	             // element is repeated must be in both arr1 and arr2
	             array[i] inside {arr1} && array[i] inside {arr2};
                     } else {
	             // element is not repeated must be in arr1 exclusive arr2
	             (array[i] inside {arr1}) != (array[i] inside {arr2});
                     }
		   }
       endclass
   
   A h = new;
   initial repeat(2) begin
      assert(h.randomize());
      $display("arr1: %p arr2: %p",h.arr1, h.arr2);
   end
endmodule