The code only passes one test case. Please check. The logic seems to be fine though
Dictionary Large
Hi @tomarvikas738, check the output for ‘abc’. The order in which it gets displayed isnt correct.
It shows:
// Input
abc// Your Output
acb
bac
bca
cba
cab// Expected Output
acb
bac
bca
cab
cba
Cab is printed after cba however it should be printed before cba. Rectify this thing in ur logic. Your code will work then. Tip: Also change in in main to some other variable.
Hope this helps 