Given an array of resource values on each planet and a limit of 7 space missions, find the maximum resources that can be collected by visiting planets in a cyclic manner, where each mission must start and end at the same planet. The planets can be visited in any order.
Explanation: Step-by-step: with input [10, 20, 30, 40, 50, 60, 70, 10], we start at planet 0, visit planets 1, 2, 3, 4, 5, 6, and then return to planet 0, giving output 290.
Explanation: Step-by-step: with input [100, 200, 300, 400, 500, 600, 700], we start at planet 0, visit planets 1, 2, 3, 4, 5, 6, and then return to planet 0, giving output 2100.
Master coding challenges related to Arrays and solve the [Backup] Galactic Resource Optimization problem optimally.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak