Any help me to find the logic
## Problem Statement: Find all the sub arrays of given input array ## **Given a valid Input Array, you need to write a method that will generate all the sub arrays of the input array and computes the sum for each sub arrays. The method has to store all the sub arrays in a 2D array and sort the 2D array according to the sum of the sub arrays, where sub array with the maximum sum occupies the first position and the sub array with the least sum occupies the last position of the 2D array.Then, the method has to return the sorted 2D array with the sub arrays of different sizes** **This exercise contains a class named PrintingSubArrays with the following methods:** +inputAcceptor() : void -Should accept inputs from the console -Should call inputValidator method with given input ------------------------------------------------------ +inputValidator(int[]) : void -Should accept input as int array and validate it -Should call displayResult with null if input is invlaid -Should call generateSubArrays method with input ------------------------------------------------------ +generateSubArrays(int[]) : int[][] -Should get array as input and return 2D array as output -Should compute all the sorted sub arrays of given input array and return as result ------------------------------------------------------ +displayResult(int[][]) : void -Should accept 2D int array as input and print it -Should print "Give proper input" if given input 2D array is null ## Example Sample Input: 4 1 2 3 4 Expected Output: 1 2 3 4 2 3 4 3 4 1 2 3 2 3 4 1 2 3 2 1 -------------------------------------------------------- Sample Input: 1 4 Expected Output: Give proper input ## Instructions - Avoid printing unnecessary values other than expected output as given in sample - Take c