Please read the new rule regarding the restriction on the use of AI tools. ×

Tkm_algo's blog

By Tkm_algo, history, 23 months ago, In English

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).

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
23 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Not completely sure if this will work:-

Spoiler
»
23 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it
Hint1
Hint2
Explanation
Code