Société Générale interview question

Write a program to check string permutation