A cinema has n rows, numbered from 1 to n. There are 10 seats in each row, labelled from 1 to n as shown above. We are given an array occupi...
Read More
Showing posts with label greedy. Show all posts
Showing posts with label greedy. Show all posts
Subscribe to:
Posts (Atom)
Sum of Subarray Minimums
Given an array A of integers, find the sum of min(B), where B ranges over every (contiguous) subarray of A. Since the answer may be large, r...