This is another continuation of https://cohost.org/fizbin/post/202670-a-supposed-straightf (programming puzzle about balanced strings) - if you haven't read that, this likely won't make sense, and you might not want to read this until you've tried solving the problem yourself one or more times. I especially encourage you to do that if you know go the language and haven't solved the problem in that yet.