@O17LPOLA020023 sir can u please check my code:https://ide.codingblocks.com/s/210944
Help needed to find error in logic
@spagire4
The issue was with printing output in lexicographic order
Your output values are correct
But output sequence is not correct
I’ve modified your code accordingly
You can see the difference