Cat Route Budget Planning (Game Adaptation)
Updated
Problem statement
Game model. Three cats each choose a route, and all routes share one action budget.
For this exercise, there are exactly three cats. Row i contains route options for cat i. Route j costs costs[i][j] action units and earns scores[i][j] points.
Choose at most one route per cat, with total action cost at most budget. A cat may stay still for zero cost and zero points. Route scores add independently. Return the maximum total score. Zero-cost routes are allowed, but each cat still gets at most one route. Keep the inputs unchanged.
Function
maxCatScore(costs: int[][], scores: int[][], budget: int) → intExamples
Example 1
costs = [[2,3],[2],[1]]scores = [[5,8],[6],[2]]budget = 4return = 11Choose the 2-cost route for the first cat and the 2-cost route for the second, earning 5+6.
Example 2
costs = [[0,0],[],[]]scores = [[3,7],[],[]]budget = 0return = 7Only one route may be selected for the first cat, even though both are free.
Example 3
costs = [[],[],[]]scores = [[],[],[]]budget = 10return = 0Every cat stays still when no routes exist.
Constraints
costs.length == scores.length == 3.- Each cat has
0..50routes; corresponding cost and score rows have equal lengths. 0 <= costs[i][j] <= 100;0 <= scores[i][j] <= 1000.0 <= budget <= 100.
More Roblox Online Assessment questions
- Centered Block Placement QueriesOA · Seen Oct 2026
- Robot Navigation Around LasersOA · Seen Oct 2026
- Factory Batch Profit (Game Adaptation)OA · Seen Sep 2026
- Nested Recipe Blocks (Game Adaptation)OA · Seen Sep 2026
- Vehicle Builds for Required Terrain (Game Adaptation)OA · Seen Sep 2026
- Track Received Byte RangesOA · Seen Sep 2026
- Break a PalindromeOA · Seen Jun 2026
- Count Pairs Differing in One DigitOA · Seen Oct 2025
- Find Zero Cells in a 2×2 GridOA · Seen Oct 2025
- Minimum Height Difference Between Distant PeaksOA · Seen Aug 2025
Similar questions at other companies
- 0/1 KnapsackConfluent · OAConfluent interview questions
- Minimum Cost to Tile a Strip with Widths 1, 2, and 3Infosys · OAInfosys interview questions
- Maximum Escape Game ScoreMicrosoft · OAMicrosoft interview questions
- Maximum Subarray SumStraive · OA
- Longest Increasing Price SubsequenceOpenAI · OAOpenAI interview questions
- Lowest-Cost Shirt Color ScheduleElevenLabs · OAElevenLabs interview questions
- Maximum Game Board ScoreJP Morgan Chase · OAJP Morgan Chase interview questions
- API Bandwidth AllocationArista Networks · OAArista Networks interview questions
- Maximum Points by Deleting ElementsIBM · OAIBM interview questions
- House RobberWalmart · OAWalmart interview questions