Pergunta de entrevista da empresa Zynga

All possible patterns in a Matrix of M*N with given Strings. Example String[] = {"abc", "efg", "hij} M = 4, N = 3; a b c ? e f g ? h i j ? ? a b c e f g ? h i j ? e f g ? a b c ? h i j ?