Tap here to switch tabs
Problem
Submissions

Problem: Sum of Subarray Minimums

med
30 min
Try to solve the Sum of Subarray Minimums problem.

Statement

Given an integer array arr, compute the sum of the minimum values across every contiguous subarray of arr. Since the result may be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 11 \leq arr.length 3×104\leq 3 \times 10^4

  • 11 \leq arr[i] 3×104\leq 3 \times 10^4

Unlock AI-Powered LearningUpgrade to smarter learning with instant explanations of Ask Agent, Personalized Interview Prep, Real-World Projects, 3 AI Mock Interviews per month, and Personalized Paths
Tap here to switch tabs
Problem
Submissions

Problem: Sum of Subarray Minimums

med
30 min
Try to solve the Sum of Subarray Minimums problem.

Statement

Given an integer array arr, compute the sum of the minimum values across every contiguous subarray of arr. Since the result may be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 11 \leq arr.length 3×104\leq 3 \times 10^4

  • 11 \leq arr[i] 3×104\leq 3 \times 10^4

Unlock AI-Powered LearningUpgrade to smarter learning with instant explanations of Ask Agent, Personalized Interview Prep, Real-World Projects, 3 AI Mock Interviews per month, and Personalized Paths