note:c++中数字组成的字符串可以直接比较大小
class Solution {
public:
string removeDigit(string number, char digit) {
string max_res = "";
for(int i=0;i
char d = number[i];
if(d != digit) continue;
string new_num = number.substr(0,i) + number.substr(i+1);
if(max_res == "" || new_num > max_res){
max_res = new_num;
}
}
return max_res;
}
};



