无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網 會員登陸 & 注冊

LeetCode 2710. Remove Trailing Zeros From a String

2023-05-28 15:06 作者:您是打尖兒還是住店呢  | 我要投稿

Given a?positive?integer?num?represented as a string, return?the integer?num?without trailing zeros as a string.

?

Example 1:

Input: num = "51230100"Output: "512301"Explanation: Integer "51230100" has 2 trailing zeros, we remove them and return integer "512301".

Example 2:

Input: num = "123"Output: "123"Explanation: Integer "123" has no trailing zeros, we return integer "123".

?

Constraints:

  • 1 <= num.length <= 1000

  • num?consists?of only digits.

  • num?doesn't?have any leading zeros.

使用stringbuilder的方法,因為stringbuilder有reverse的函數(shù)。

Runtime:?5 ms, faster than?50.00%?of?Java?online submissions for?Remove Trailing Zeros From a String.

Memory Usage:?44.4 MB, less than?12.50%?of?Java?online submissions for?Remove Trailing Zeros From a String.


LeetCode 2710. Remove Trailing Zeros From a String的評論 (共 條)

分享到微博請遵守國家法律
景东| 特克斯县| 南召县| 邵阳县| 绥化市| 宁阳县| 大化| 西乌珠穆沁旗| 鄂伦春自治旗| 黄浦区| 巨野县| 来凤县| 富顺县| 玛多县| 札达县| 绵阳市| 沈丘县| 当涂县| 松原市| 文水县| 漾濞| 拉萨市| 化州市| 九江市| 灵石县| 新和县| 临泽县| 紫金县| 铁力市| 温宿县| 卓资县| 盖州市| 镇远县| 尚志市| 平凉市| 莲花县| 慈利县| 普陀区| 蒙山县| 涞水县| 商水县|