I don't see where you check that the key is already broken for additional broken keys. But I think you do it somewhere if you passed sample input/output.
Might it be possible that - by accident - judge input data contain in the line with word "finish" additional space or another white character at the end (or beginning)? In such case my program could work wrong. Does anybody know it?
Xyz
This problem should be easy, but you have to be
patient
END
life
is
sometimes
tough
but there must be a way
END
but
one
must
not
give
up
and he should keep going
END
END
END
abcdefghijklmnopqrstuvwxyz
no line can be possible
END
finish
Xyz
This problem should be easy, but you have to be
patient
END
life
is
sometimes
tough
but there must be a way
END
but
one
must
not
give
up
and he should keep going
END
[color=red][b]END
END[/b][/color]
abcdefghijklmnopqrstuvwxyz
no line can be possible
END
finish
But is it possible that the line itself can contain the word "END"? If yes, then how could you know the end of the test case? Do you need to count the lateset END for end of that case?
the "END " r interpreted as follows in the example....
1st end as the end of 1 input
2nd end as the broken keys
3rd end as the end of the next input
between 2nd and 3rd 'end' theres no other line except 'end' which need to be processed .....
I got some W.As because that I assume all characters at the first line of input are letters. In fact, it may not be all letters!
If you got W.A. and still don't know why, remember to check that.
Have you ever...
Wanted to work at best companies?
Struggled with interview problems that could be solved in 15 minutes?