Rogue_Ronin's blog

By Rogue_Ronin, history, 2 years ago, In English

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]}.

  • Vote: I like it
  • -5
  • Vote: I do not like it

»
2 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Can you send the link of this problem ? It seems weird that we have to calculate it for each subarray ...