Cutting ribbons

0
Remix

You have pieces of wood (or ribbon) of given lengths and need k pieces of equal length; you may cut but not join. Return the longest length that still yields at least k pieces. Binary search on the length, counting pieces for each guess.

MetaCodingLast asked Sep 2025
No answer yet. Write the first one; the best answer gets endorsed.