HashedIn by Deloitte interview question

They asked me solve one Backtracking(Permutation) problem in technical round one and the problem is paranthesis generated !