Algorithm · ByteDance · Medium
You are given an integer array piles where piles[i] indicates how many items are in the i-th pile, and an integer h representing the total number of hours you have to finish them. Every hour you must select exactly one pile that still contains items and remove up to k items from it. If the pile has fewer than k items left, you clear it and any unused capacity in that hour is discarded — you cannot use the remainder on a different pile. Your task is to determine the smallest…
Checking your access…