Domanda di colloquio di Wayfair

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

Risposta di colloquio

Anonimo

26 feb 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.