Back to problems

Bitonic Partitioning

Algorithm · Rubrik · Hard

You are given an integer array arr of length n (where n <= 100). Your task is to count the number of ways to split the array into contiguous partitions such that the sequence of partition averages forms a bitonic sequence. A bitonic sequence strictly increases, then strictly decreases, and must have at least three partitions to exhibit both phases. For each partition, its representative value is the average of its elements. A valid partitioning must satisfy: There are at…

Checking your access…