Please help me Guys...
Mekata podi help 1k denna puluwan kenek innawada?
Write methods (return type void) for each problem given below which take an array with 10000 integers (data type: int) as the input parameter and print expected output. The array is virtually broken into chunks of similar length and length of the chuck defined in the related question (given below). Items within a chunk are sorted in descending order. Your methods should print the starting index and the sum of the chunk which has maximum sum of its elements. If there are more than one chunk with maximum sum, very first applicable chunk should be taken as the solution. You are going to address a very specific problem (eg: number of elements in the array is fixed, chuck sizes are pre-defined) so your solution is NOT required to be a generic solution which works for any input.
i) Print starting index and sum of the chunk which has maximum sum of its elements when the chunk size is 100.
ii) If you think that you can come up with a higher optimized solution when the chunk size is 1000, write another method to print starting index and sum of its elements which has maximum sum among other chunks.
iii) If you think you have a better optimized solution if the chunk size is 10000, write an optimized method to print starting index of relevant chunk and its sum.
Here are some examples:
• In problem (i), if the chunk starting from 300 has the sum of 100000 and 100000 is the maximum sum among other chunks, and then you should print a similar text as following text.
“ Starting index : 300”
“ Sum of chunk : 100000”
• In problem (ii), if the chunk starting from 3000 has the sum of 1000000 and 1000000 is the maximum sum among other chunks, and then you should print a similar text as following text.
“ Starting index : 3000”
“ Sum of chunk : 1000000”
Mekata podi help 1k denna puluwan kenek innawada?Write methods (return type void) for each problem given below which take an array with 10000 integers (data type: int) as the input parameter and print expected output. The array is virtually broken into chunks of similar length and length of the chuck defined in the related question (given below). Items within a chunk are sorted in descending order. Your methods should print the starting index and the sum of the chunk which has maximum sum of its elements. If there are more than one chunk with maximum sum, very first applicable chunk should be taken as the solution. You are going to address a very specific problem (eg: number of elements in the array is fixed, chuck sizes are pre-defined) so your solution is NOT required to be a generic solution which works for any input.
i) Print starting index and sum of the chunk which has maximum sum of its elements when the chunk size is 100.
ii) If you think that you can come up with a higher optimized solution when the chunk size is 1000, write another method to print starting index and sum of its elements which has maximum sum among other chunks.
iii) If you think you have a better optimized solution if the chunk size is 10000, write an optimized method to print starting index of relevant chunk and its sum.
Here are some examples:
• In problem (i), if the chunk starting from 300 has the sum of 100000 and 100000 is the maximum sum among other chunks, and then you should print a similar text as following text.
“ Starting index : 300”
“ Sum of chunk : 100000”
• In problem (ii), if the chunk starting from 3000 has the sum of 1000000 and 1000000 is the maximum sum among other chunks, and then you should print a similar text as following text.
“ Starting index : 3000”
“ Sum of chunk : 1000000”
Last edited:



