As Buckets effect reveals, the capacity of a bucket depends on the shortest board. This is a theory in 3D, an now consider a similar problem in 2D. Given a string of integers, each integer is non-negative, and each integer represents the height of a board which of the width is 1. Compute the capacity of buckets based on Buckets effect.