How to solve this subarray problem?

Правка en1, от Rogue_Ronin, 2022-08-05 15:26:20

I saw this problem in an OA recently, and I've got no clue yet....

Question: Given an array A, for each subarray of A, calculate the sum of all the elements that are not the maximum or the minimum of that subarray.

Example: A = [1,2,3,4], answer would be 5 {for subarrays [1,2,3] and [2,3,4]}.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Rogue_Ronin 2022-08-05 15:26:20 342 Initial revision (published)