l**********n 发帖数: 8443 | 1 the following is not memory efficient, how to make it more efficient
while(str.charAt(0) == '0') {
str = str.substring(1);
} | g*****g 发帖数: 34805 | 2 do a charAt(i) until not 0 and substring one time.
【在 l**********n 的大作中提到】 : the following is not memory efficient, how to make it more efficient : while(str.charAt(0) == '0') { : str = str.substring(1); : }
| s***a 发帖数: 43 | 3 用String builder?
【在 l**********n 的大作中提到】 : the following is not memory efficient, how to make it more efficient : while(str.charAt(0) == '0') { : str = str.substring(1); : }
|
|