Company: Onix
Difficulty: medium
Sorting: Minimum Sum Tessa has an array of integers. She writes the sum of all non-empty continuous subarrays. You have to print the minimum sum possible using any K of obtained sums of continuous subarrays. Since the answer can be a huge number, print answer modulo 10 9 +7. Function Description In the provided code snippet, implement the provided getMinSum(...) method. You can write your code in the space below the phrase \"WRITE YOUR LOGIC HERE\" . There will be multiple test cases running so the input and Output should match exactly as provided. The base Output variable result is set to a default value of -404 which can be modified. Additionally, you can add or remove these output variables. Input Format The first line of input contains two integers N and K . The second line of input contains N integers, i.e. the given array. Constraints 1 ≤ N ≤ 10 4 1 ≤ K ≤ N ×( N +1)/2 1 ≤ Element of array ≤ 10 9 Sample Input 4 5 1 2 3 4 Output Format The output contains a single integer denoting