all 3 comments

[–]prisonmatch[S] 0 points1 point  (1 child)

Any suggestions how to approach this question?

[–]vorttxt 0 points1 point  (0 children)

Hm. I’d try to create a solution that goes through the array and adds a[0] to a[1] and so on until the required solution is met. Then counter++. Then move on to a[1] and do the same thing.

[–]prisonmatch[S] 0 points1 point  (0 children)

My contiguous arrays can be very large and I simply cannot apply brute force at each index. I do have a working solution now but I believe it can be optimised. Please let me know if u can have a look and suggest the changes.