Compute max profit with forced trades | Retool Interview Question