Which test cases am I missing here?
https://www.codechef.com/viewsolution/14592888
Thanks
PS: Please upvote the question so that I get proper reputation for upvoting other answers. Thank You.
Which test cases am I missing here?
https://www.codechef.com/viewsolution/14592888
Thanks
PS: Please upvote the question so that I get proper reputation for upvoting other answers. Thank You.
what if the test case is
β<<<<β
or
β>>>>β
your loop stops when u get another sign!!
but what if u dont get any?
my solution!!
https://www.codechef.com/viewsolution/14422984
hope this helped you
Code is working fine on this test case. Itβs giving 5 as the output.
His logic is almost correct. He is missing on very few edge cases, which i assume are repeated in those test cases.
If this helps , you have to count the longest consecutive subsequence of same characters (other than =)
Your int k has been left undefined in this case, which occasionally may equate to word.size() (especially if the last string has the same length as the current string) and terminate your loop early when the test case start with an β=β. Set int k = 0; and you should pass the test cases.
That was surely a really very silly mistake. Code is working perfectly now!