Getting blank answer on submitting but correct answer on testing with same input


When I submit, site says that my submission is giving blank result for below input. But when I run it as custom test case, I see correct answer.

9 bababbbb bbbabaa abbb a aabbaab b babaabbbb aa bb


Global Variables don’t work in submit but work in custom input.Huge bug of this site.Even test cases contain whitespace at end and you have to waste your time debugging what went wrong only to find this. Very poor judge.