You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! Really liked your solution and thank you for the great explanation, I was having a hard time with this problem.
Anyway, I noticed a (very) small problem on your code for problem 88. It's pretty much meaningless, but you might want to fix it either way.
You'll notice that if you run your code for 2 <= k <= 6, compute(6) will return 18, when it should return 30. The problem is on line 69: array = array[2:limit].
The array is being cut too short and will not include the minimal product-sum for k = 6. If we print the array on line 69, we have [4, 6, 8, 8].
Changing the line to array = array[2:limit + 1]: [4, 6, 8, 8, 12].
I wonder if it's not a problem for any k > 6. It sure isn't for 12000.
Again thanks for your solution and explanation.
The text was updated successfully, but these errors were encountered:
I'm really glad you liked my solution and that you pointed out this error to me, I have updated it.
Interestingly, you get the same answer for a few values of k near 12,000. This must've been one of the rare times I wrote up the code, clicked run and the submitted answer happened to be correct on the first try and I didn't check further.
Hey! Really liked your solution and thank you for the great explanation, I was having a hard time with this problem.
Anyway, I noticed a (very) small problem on your code for problem 88. It's pretty much meaningless, but you might want to fix it either way.
You'll notice that if you run your code for 2 <= k <= 6, compute(6) will return 18, when it should return 30. The problem is on line 69:
array = array[2:limit]
.The array is being cut too short and will not include the minimal product-sum for k = 6. If we print the array on line 69, we have [4, 6, 8, 8].
Changing the line to
array = array[2:limit + 1]
: [4, 6, 8, 8, 12].I wonder if it's not a problem for any k > 6. It sure isn't for 12000.
Again thanks for your solution and explanation.
The text was updated successfully, but these errors were encountered: