l1 and l2, to keep track of the maximum profit for 1-price and 2-price sequences respectively.prices and profits.l1 with the current profit if it's higher than the existing profit for the current price.l2 with the sum of the current profit and the profit from the 1-price sequence (2-price sequence).l2 for the maximum profit of a 2-price sequence for any price less than the current price and add the current profit to check if it results in a higher overall profit.