private void print(List<List<String>> input, int[] result, int pos) {

        if(pos == result.length){
            for (int i = 0; i < input.size(); i++) {
                System.out.print(input.get(i).get(result[i]) + " ");
            }
            System.out.println();
            return;
        }

        for(int i=0; i < input.get(pos).size(); i++){
            result[pos] = i;
            print(input,result, pos+1);

        }
    }
Date 07/20/2015
@author Tushar Roy

Given a list of list of Strings. Print cartesian product of lists.
input -> {"Hello", "World"} , {"Game"}, {"Go","Home"}
output ->
Hello Game Go
Hellow Game Home
World Game Go
World Game Home
src/com/interview/recursion/WordCombination.java