Saturday, May 18, 2024

📑 Max Product of Three

📑 Task

1) Find a mistake in the process of recursion the function
for calculating the maximum product of three numbers in the list
2) Suggest a possible decision to build a recursive function

📑 Answer

1) Incorrect recursion logic: if the list becomes longer by one element,
then all the indices of the elements that give the maximum product
could be changed, not only one index
2)