Where were you a month and a half ago? Probably not implementing this function:
long long f(string s)
You may assume 1≤|s|≤104. You might have tried O(|s|4) before, but it will net you zero points on this question.
you can't have any global variables
But yes, you can. They just don't get reset each time your method is called.
Comments
you can't have any global variables
But yes, you can. They just don't get reset each time your method is called.