In one of my java program, I need to use exactly what product function from itertools offers, permuting an array reapeating k times.( perm=itertools.product(arr,repeat=k)).
for ex. for arr=[4,5] and k=3, the output should be:
(4, 4, 4)
(4, 4, 5)
(4, 5, 4)
(4, 5, 5)
(5, 4, 4)
(5, 4, 5)
(5, 5, 4)
(5, 5, 5)
I want to ask if there is any utility or something in java which can facilitate this in java? I have been looking for it over the internet, but couldn't find it anywhere.
Please share something if you know what could be done in this case.