Hi all, since the competition is over, can someone please provide with sample input cases, my code is surely failing for just 1,2 cases, i have tried every case but its working for me. If someone can help, thanks in advance
for @kirat_saluja question
check for input
output will be
not for @bipin2’s question
for the time being please do check my code. If you dont understand dont mind asking. I am just looking. Let me look… if you understand the mistake please do tell.
@sanzzzay: i checked that one… THat was the first input that i checked It works correctly :\
can you tell me what
if ( (ch[i]==replace[j]) and (check[i]==0) ) is doing in C++, some reference please
@betlista: i did not understand your question. Did you ask what is check[i] used for? If the value of check[i]==1 then we can understand that it has al-ready been replaced. We need not re-place it.
@betlista: just like a flag variable it acts. By the way you are a genious and are you making fun of me by asking me such doubt?
He is getting the correct output for that.
@kirat_saluja: Here is the correct one. I debugged your code. I added some statements which are of C++ syntax. Hope you know the c++ syntax. I checked the code in my account. Ran in 2.00 seconds.
You problem was with the loop. You interchanged the indices. i and j. You were checking the reverse.
Have debugged the entire stuff and here is the code [here]
If you have any problem with syntax please do ask me…
@the test case which you told him was getting the right output. His mistake was something else and i have debugged it. I am sorry if i have offended you. Really sorry buddy… Happy?
I have spend around 30 minutes to de-bug the code. And it is dissapointing that we get some -ve votes here even after doing some good.
@same was i am trying and you have started given 2 down vote back to back also in the one question where question is asked by someone else
yea i am fine …
Sorry, I was not asking about replace and check arrays, but frankly I do not know how the
and is used in C++, I’m Java guy is it the same as
&& ? You know, it’s not easy to google for “and”…
oh!!! @betlista: haha… I thought you being a genius is trying to mock me
Yes BOSS in C and C++ instead of ‘&&’ can use ‘and’ and instead of ‘||’ we can use ‘or’
I am planning to make a new post very soon which includes some tricky facts about C and C++ which can be helpful to newbies while taking part in coding contests.
I did it because you were giving test cases which his code produced the correct output. And i told you and it was giving the same and still went on and posted the same test case. That is why i down-voted.
ok for @kirat_saluja case you are gonna judge me fine …if @kirat_saluja would have given me a downvote it is fine because its his doubt and his perspective and yours perspective may differ my answer was not for your question ,it was for @kirat_saluja … and i didnt find any link regarding his code so how am i supposed to debug it …
@sanzzzay: what i told was that the test case which you were providing was not the one which was causing the mistake. I commented it twice and you were posting the same. I repeat I am sorry for Down-voting.