about | help | code help+videos | done | prefs |
Write a method that returns 'true' if it is possible to make the 'targetProd' by multiplying numbers selected from the 'nums' array. Return 'false' if it is not possible. For example, if 'nums' is {5,10,3,2} and 'targetProd' is 100, you would return 'true' because the product of 5, 10, and 2 is 200. However, with the same 'nums' array, if 'targetProd' is 17 you would return 'false' because no combination of numbers from 'nums' will multiply together to give you 17. Look at the test data for examples. prodPossX2([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59], 902) → true prodPossX2([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59], 3128) → false prodPossX2([7, 10], 70) → true ...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: 410
Copyright Nick Parlante 2017 - privacy