Paytm Money Interview Question

Hacker Rank program to return lexocographically largest permutation of binary string