Company: Grow_2july
Difficulty: medium
Variable Market Problem Description There is a rush for crypto stocks in the variable markets and there is a pipeline for buying stock. Total requested amount of N persons is put in the pipeline, sequence wisem i.e., the 1st person with their request amount, then the 2nd person with their request amount, etc. You are given fixed tax charges for stock buying. For the first transaction, the tax amount is K and for the next transaction, it is K+Y, then K+2Y, 3Y, so on. The first amount in the pipeline is used first for buying the crypto stock. The following process is followed for the first amount in the pipeline: The (i+1)th element and the (i+2)th element are compared. If the (i+1)th element is greater than the (i+1)th element, swap both values. The elements are compared from the front to the back, i.e., left to right. The process of buying the 1st requested amount ends after all elements are compared. The next element is considered the first amount or front, and the process continues u