Compute max profit from single stock trade | Meta Interview Question