ThousandEyes Interview Question

calculate the combination of an array of array