leetle

Daily challenge for 2026-09-19

627. Cargo Ramp Capacity Limit

You are managing a warehouse shipping ramp that has a fixed daily weight limit. You are given a sorted list of daily shipping records weights where each entry is the total weight shipped on that day. You are also given an integer capacity representing the ramp's safe operating threshold.

Return the total number of recorded days on which the shipping ramp operated within its safe capacity (i.e., days where the shipped weight was less than or equal to capacity).

Example:
Input: weights = [120, 150, 180, 210, 240], capacity = 190
Output: 3

Run this challenge interactively in Python or JavaScript when the app loads.