sir please check my code https://ide.codingblocks.com/s/166805 where i am getting wrong and please tell is my approach is correct or not
my four cases are wrong and 5 are right
also sir please tell me better approach then this
Getting some cases wrong
Hello @pankajsingh
Why are inserting the element “q” into the vector.
Better approach would be
int cnt = 0
int start = -1
for(int i = 0; i < length; i++) {
search for the cb number in minimum “i” possible starting from start
if(cb) number is found make start = i and cnt++
}
Here is the code
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.