What is wring with my code?


Code gives right ans but is unable to clr any testcase

hi… ur logic doesn’t seem to be correct… try doing like this https://ide.codingblocks.com/s/590987

This approach was explained by the teacher while live class, whats wrong with this one?

please tell why this method is inappropriate?

u are saying Prateek bhiya or any other teacher has explained this apporach??

yes, during weekly live zoom classes

okay… let me see…

1
4
100 100 1 1
u code is failing on this test case.
ur o/p 10010011
expected o/p 11100100

ok, please share the right approach

have already shared with u above

yes, but it has gone due to other chats and I’m unable to access it

refer this https://ide.codingblocks.com/s/590987

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.

https://ide.codingblocks.com/s/590987 Please explain the cout in the code

what’s your doubt??

cout is used to print the statement in console

no, i meant, why is it printing it differently, It should print XY amd YX instead, It prints XY and YXY

https://ide.codingblocks.com/s/650436 check in this

yes this is because
when you write string XY = X.append(Y); then x become XY
and now after Y.append(X); Y becomes YXY

so instead of append simply use +
XY = X+Y;
YX = Y+X;

Unable to clear all testcases https://ide.codingblocks.com/s/650613

Print endl after each testcase
Inc size of vector from 10 to 1000

After that all testcase should passed