Grokking the Engineering Manager Coding Interview
Ask Author
Back to course home

0% completed

Vote For New Content
Example 3 Expected Output should be 27, not 35

singhursefamily

Apr 8, 2025

I believe the expected output in Example 3 should be 27, not 35. In fact, the sum in the last bullet point is 27.

Example 3:

  • Input: arr = [7, 3, 8]
  • Expected Output: 35
  • Explanation:
    • The subarrays are: [7][3][8][7,3][3,8][7,3,8].
    • The minimum values of these subarrays are: 7, 3, 8, 3, 3, 3.
    • Summing these minimums: 7 + 3 + 8 + 3 + 3 + 3 = 27.

1

0

Comments
Comments