Hello,
I'd like to share a problem with you that me and my friends cannot solve. Statement is really short and simple:
Given a sequence of n integers find number of balanced intervals in it. Balanced interval is an interval where all occurring elements have the same number of occurrences, e.g. 1, 2, 2, 1 or 4, 5, 2, 2, 4, 2, 5, 5, 4
Thanks!