[UVA] 12385 - Interesting Sequences
I - Interesting Sequences
For a sequence of integer numbers <x1,x2,…,xn>,
a contiguous subsequence <xi,xi+1,…,xj>
where i<j≤n, is called "interesting"
if its first and last elements are equal
(i.e., xi=xj). Two interesting subsequences S1=<xi,xi+...