Need help in this ques!!!

Revision en1, by _wannacry_, 2024-07-15 13:12:07

We are given an array of integers of size ’n’. There is an infinite supply of each integer of the array. Now, for each index in the array, the task is to calculate all the possible ways in which the integer present at that index can be obtained by adding up 3 integers from arr[0], arr[1]…arr[i-1] (considering the calculation is being done for the index ‘i’). Since, there is infinite supply, repetition of one element is allowed, i.e., all the three integers can come from the same index of the array.

Constraints: Size of array could be as large as 10⁵

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English _wannacry_ 2024-07-15 13:12:07 583 Initial revision (published)