you give 0indexed 2D integer array transaction transactionsi costi cashbackiThe array describe transaction transaction complete exactly order at give moment certain money in order complete transaction money costi hold true after perform transaction money money costi cashbackireturn minimum money require transaction transaction complete regardless order transaction example 1input transaction 215042output 10explanationstarting money 10 transaction perform orderIt show start money 10 fail complete transaction orderexample 2input transaction 3003output 3explanation if transaction order 3003 minimum money require complete transaction 3 if transaction order 0330 minimum money require complete transaction 0Thus start money 3 transaction perform order Constraints1 transactionslength 105transactionsilength 20 costi cashbacki 109