about | help | code help+videos | done | prefs |
Write a method that returns true or false indicating if the maximum possible weight can be packed based on the weights of the individual items in the 'weights' array. Keep in mind that sometimes you can get closer to the maximum by using a larger number of lighter items. For example, if you have weights of {50, 20, 20, 20} and a maximum weight of 62, you can get closer to the maximum weight using the three 20's. Just saying. The index parameter will always be passed in as zero on the first call. This can be useful for you perhaps. Just saying. orderSystemMaxPackAdvanced2([5, 7, 12, 2, 3], 0, 19) → true orderSystemMaxPackAdvanced2([4, 9, 1, 200], 0, 201) → true orderSystemMaxPackAdvanced2([4, 9, 1, 200], 0, 16) → false ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 490
Copyright Nick Parlante 2017 - privacy