P8.1 EquiLeader
Find the index S such that the leaders of the sequences A[0], A[1], …, A[S] and A[S + 1], A[S + 2], …, A[N - 1] are the same.
- P8.1 超频数索引
寻找使得A[0], A[1], …, A[S]和A[S + 1], A[S + 2], …, A[N - 1]的超频数相同的索引S
由N个整数组成的非空数组A。出现次数达到数组所有元素个数的一半以上的数为该数组的超频数。
超频数索引是一个索引S,其中0≤S<N−1,此索引将数组分为两个数组:A[0], A[1], …, A[S]和A[S + 1], A[S + 2], …, A[N - 1],并且这2个数组具有相同值的超频数。
例如,给定数组A:A[0]=4,A[1]=3,A[2]=4,A[3]=