Teradata Interview Question

Whiteboard: Calculate string permutation