维护一个字符串 SSS,要求支持如下操作:
以下是哈希值计算的伪代码:
Function hash(String s): result = 0 mod = 998442353 base = 998244353 For char in s: result = (result * base + Int(char)) % mod return result