Which line will complete the ABOVE code?
prices[j-1] + max_val[tmp_idx]
prices[j] + max_val[tmp_idx]
prices[j-1] + max_val[tmp_idx - 1]
prices[j] + max_val[tmp_idx - 1]
Correct Answer: A — prices[j-1] + max_val[tmp_idx]
Explanation:
prices[j-1] + max_val[tmp_idx] completes the code.