Given an array of intergers divide them into n subsets such that difference between sum of each subset is minimum.
Example : input [1,1,4,2,8] and n=2 ; output = [1,1,4,2] and [8]
input [1,1,4,2,8] and n=3 ; output = [1,1,2] and [4] and [8]
Round 2:
A frog is at starting index of array of length having n. Some indexes of array has obstacles. Frog can either move 1 step or jump m steps only when there is obstacle. Write a program to tell if frog can reach last index of array.