solve to input array of array