give array integer arr replace element rankthe rank represent large element the rank follow rulesrank integer start 1the large element large rank if element equal rank sameRank small possible Example 1input arr 40102030output 4123explanation 40 large element 10 small 20 second small 30 smallestexample 2input arr 100100100output 111explanation same element share rankexample 3input arr 37122891005680512output 534286713 constraints0 arrlength 105109 arri 109