class Solution { public: string maxLexicographical(string num) { int i = 0; while(num[i]=='1') i++; while(num[i]=='0') num[i++]='1'; return num; } };