Lets say you have input Array A with with input length N and you have also input number M which defines how many array cuts you need to have. The goal is to return all possible cuts.
N/M <= 1
So for example if you have Array A = [1,2,3,4] and M = 1
solution is array L containing arrays
[ [1] [2,3,4] ]
[ [1,2] [3,4] ]
[ [1,2,3] [4] ]
empty partitions are not allowed
Best Answer