Wayfair Interview Question

Print out all combinations from an array or arrays. Example: Input: [ [ a, b ], [ c, d, e ], [ f, g ] ] Output: acf acg bcf bcg ... aeg

Interview Answer

Anonymous

Feb 26, 2019

How did you solve this one? What was the complexity? Which language did you use? I instantly thought of Python's itertools.product but that finishes the program in 2 lines and am not sure if that can be used in the interview.