Google | Onsite | Find partitions

Find the number of partitions of an array such that each contiguous partition consists of atleast one negative number.
eg. [-1,-2,-3,-4] has these possible partitions :
[-1],[-2],[-3],[-4];
[-1,-2],[-3,-4];
[-1,-2,-3] ,[-4];
[-1],[-2,-3,-4];
[-1][-2,-3],[-4];

Comments (33)