Multiple choice

Given two arrays of numbers a1,..........., an and b1,............, bn where each number is 0 or 1, the fastest algorithm to find the largest span (i, j ) such that ai + ai+1 + .........+ aj = bi + bi + 1 +...........+ bj is:

  1. O(n2)

  2. O(n3)

  3. O(nlogn)

  4. O(2n)

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

null