This is the problem in June 2012 Long Challenge. Can anybody point out why i got WA in this problem.
Here is the solution link
I tried it and it returns
0
for input
1
0?
and it’s not stopping for input
1
01
1 Like
You deal with the case K=2 in a wrong way. You can’t set first character for K=2 only looking at its neighbors. Try this test:
2
??1?
2 Likes
thanx. got it
got correct results for your test cases
try this input:
2
1
?
2
?