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. Interval is balanced if 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 or 100, 100
Thanks!