deleting solution by counting combinations as the algorithm to check the elements distribution does not work well
adding Groovy implementation of IntegerArray