Блог пользователя Tkm_algo

Автор Tkm_algo, история, 19 месяцев назад, По-английски

Hi, I can't solve this problem for 3 days now. Please help me solve this problem: Two arrays of the same length (n) are given. Need to find any segment so that the sum of the elements of the first array on this segment is equal to the sum of the elements of the second array on this segment. Need to solve in O(n).

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Not completely sure if this will work:-

Spoiler
»
19 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится
Hint1
Hint2
Explanation
Code