Pergunta de entrevista da empresa Google

Write a code to generate permutations of many strings which can be used as a base library by users to get next permutation every time they use the library function.