i am getting three cb numbers but one contain two cb number how to deselect it …
here is my code …
please explain the changes in detail
thank you in advance
i am getting three cb numbers but one contain two cb number how to deselect it …
here is my code …
please explain the changes in detail
thank you in advance
@Diwyanshu hey to make sure that you do not have 1 CB number enclosing other CB numbers.
First find all the CB numbers of len 1, then of len 2 and so on.
Also maintain an array that tells which positions have been used so that you do not use them again.
If this resolves your doubt mark it as resolved.
I PASSED ALL TEST-CASE BUT I THINK MY PROGRAM IS NOT EFFICIENT …
PLEASE SUGGEST ME A GOOD APPROACH OR ANY REFERENCE
HERE IS MY PROGRAM…
@Diwyanshu
Refer to this code.
Before running remove the indef lines in main function.
If thi resolves your doubt mark it as resolved.
bitset <17> &visited
bitset<17> visited;
thank you i understood but can you explain this 2 terms …
@Diwyanshu bitset is an boolean array but it size is in bits. bitset<17> visited is creating an visited array of size 17 .
bitset<17> &visited is in parameters, it means that visited is passes by parameter.
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.