Question d’entretien chez Paytm Money

Hacker Rank program to return lexocographically largest permutation of binary string