like we would always be getting an non decreasing array even after the first mad operation, so we can devise a formula from there and get the answer like i have done in the submission (355125607). but i still dont understand whats the need of second mad operation. moreover even after following the rules on the second mad array its quite possible that any number might appear only single time like for example the last element
like we would always be getting an non decreasing array even after the first mad operation, so we can devise a formula from there and get the answer like i have done in the submission (355125607). but i still dont understand whats the need of second mad operation. moreover even after following the rules on the second mad array its quite possible that any number might appear only single time like for example the last element