C++ code of the problem

please send the c++ code of this problem as editorial has code in java

Hello @dhasmanasaksham572 check this:


if you have any doubt you can ask here;
Happy Learning!!

this is not working for n=9

@dhasmanasaksham572 it is working fine for n=9 as well.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.