Daily challenge for 2026-07-06
552. Optimal Toy Assembly
You are given an array of integers costs, where each element represents the time cost to assemble a specific toy. You are also given an integer maxTime, representing the total time you have available. Return the maximum number of toys you can assemble within the given time limit.
Example:Input: costs = [1, 3, 2, 4], maxTime = 5Output: 2
Explanation: You can assemble the toys with costs 1 and 2 for a total time of 3, which is less than or equal to 5. It is impossible to assemble 3 toys within 5 units of time.
Run this challenge interactively in Python or JavaScript when the app loads.