NeetCode #296LC-1891MediumBinary Search
← Back to All Problems

#296 · #1891 · Cutting Ribbons(割绳子)

📌 Problem Statement & Constraints

You are given an array ribbons where ribbons[i] is the length of the i-th ribbon, and an integer k. You may cut each ribbon into pieces of equal integer length; leftover material is discarded. Return the maximum possible piece length so that you obtain at least k pieces, or 0 if impossible. Constraints: 1 <= ribbons.length <= 10^5, 1 <= ribbons[i] <= 10^5, 1 <= k <= 10^9.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!