codeforces round 531(div3) D. Balanced Ternary String

NoSuchKey