For every substring $$$[L, R]$$$, count the number of substrings that have an equal number of 0s and 1s. Then print the sum over all possible $$$[L, R]$$$.
I made a video discussing ideas to solve this problem. https://youtu.be/LWJ7jKnqi9k
Practice problem https://codeforces.me/problemset/problem/1996/E








good problem