top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

C: Array consist of -1 and 1, Find count of all sub-arrays where sum = 0.

+1 vote
318 views

Array consist of -1 and 1, Find count of all sub-arrays where sum = 0.
Input:
[-1,1,-1,1]

Output:
4
[-1,1] [1,-1],[-1,1],[-1,1,-1,1]

posted Feb 8, 2017 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

...