Spaceship Equipment Loadout
Updated
Problem statement
Choose one fixed subset of spaceship equipment whose total weight does not exceed capacity. Equipment item i mitigates every hazard listed in protections[i]. A test run is fully mitigated when every hazard in that run is covered by at least one selected item.
Exactly five runs are supplied. Maximize the number of fully mitigated runs. Break ties by smaller total equipment weight, then by the lexicographically smaller sorted list of selected equipment names. Return that sorted name list.
Function
optimizeLoadout(capacity: int, equipmentNames: String[], weights: int[], protections: String[][], runs: String[][]) → String[]Examples
Example 1
capacity = 7equipmentNames = ["Armor","Laser","Shield","Net"]weights = [4,3,4,2]protections = [["debris"],["pirates"],["asteroids"],["debris","pirates"]]runs = [["pirates"],["debris"],["asteroids"],["debris","pirates"],["pirates"]]return = ["Net","Shield"]Net and Shield weigh six and fully mitigate all five runs.
Example 2
capacity = 3equipmentNames = ["A","B","C"]weights = [2,2,3]protections = [["pirates"],["debris"],["pirates","debris"]]runs = [["pirates"],["debris"],["pirates","debris"],["asteroids"],["pirates"]]return = ["C"]C is the only feasible single item that fully mitigates both the combined run and the other covered runs.
Constraints
1 <= equipmentNames.length <= 18.weights.length == protections.length == equipmentNames.length.- Equipment names are unique; every weight is positive.
runs.length == 5, and every run contains at least one hazard.- Hazard names and equipment names are non-empty ASCII strings.
More Jane Street interview questions
- Code Editor FoldingONSITE INTERVIEW · Seen Oct 2026
- Exact-Sixty Dice Game ValueONSITE INTERVIEW · Seen Oct 2026
- Expected Value of Modified DiceONSITE INTERVIEW · Seen Oct 2026
- Two-Tower Strategy GameONSITE INTERVIEW · Seen Oct 2026
- Wizard Scroll Allocation StrategyONSITE INTERVIEW · Seen Oct 2026
- Sort TradesPHONE SCREEN · ONSITE INTERVIEW · Seen Jul 2026
- Order Matching EngineONSITE INTERVIEW · Seen Jul 2026
- Order Book Data ValidationONSITE INTERVIEW · Seen Nov 2025
- Biggest Daily Move and Longest Rising StreakOA · ONSITE INTERVIEW · Seen Apr 2021
- Maximum-Scoring Consecutive Tree LevelsPHONE SCREEN · Seen Nov 2026
Similar questions at other companies
- Cats, Rabbits, and Snails Board GameAsana · ONSITE INTERVIEW
- Find GPU Capacity and Drain a NodeTogether AI · PHONE SCREEN
- Random Dasher Set OperationsDoorDash · ONSITE INTERVIEWDoorDash interview questions
- Propagating Fraud DetectorAffirm · PHONE SCREEN · ONSITE INTERVIEWAffirm interview questions
- Deep Copy a Random-Pointer ListAmazon · ONSITE INTERVIEW
- Digit-Coded Card ValidationCapital One · ONSITE INTERVIEWCapital One interview questions
- Instant-Runoff Voting WinnerWise · ONSITE INTERVIEW
- Candy Crush Grid Matching and GravityRoblox · PHONE SCREEN · ONSITE INTERVIEWRoblox interview questions
- Online Meeting Scheduler with Fixed RoomsUber · ONSITE INTERVIEWUber interview questions
- Compress Editor Actions into Operational Transform OperationsReplit · OA · PHONE SCREEN · ONSITE INTERVIEW
Jane Street interview experiences
- Jane Street TDO UK and Hong Kong: 22 Experiences (Part 10 of 10)
- Jane Street TDOE US Final Round: 11 Experiences (Part 5 of 10)
- Jane Street TDO Phone Math Round: 26 Experiences (Part 9 of 10)
- Jane Street TDOE UK Phone Screen: 15 Experiences (Part 4 of 10)
- Jane Street TDO Excel and VBA Test: 23 Experiences (Part 8 of 10)
- Jane Street TDOE UK Coding Round: 15 Experiences (Part 3 of 10)