cswork / OAOpen practice workspace

UberOA #49

Maximum Value of L (For off-campus 2025 batch hiring :)

Estimated MediumStatement and editorial — judging is being prepared

Topics (AI-labelled)Binary SearchPrefix & Ranges

There is a magical forest with N trees, each tree i (0 Input: The first line of input is the number of trees and the value of K. The second line consists of N space-separated values denoting the number of fruits on each tree. Output: The maximum value of L

Example 1

Input:

fruits = [3, 1, 2, 4]
k = 8

Output:

3

Explanation: :)

Editorial

Loading solution…