国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

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

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的評論 (共 條)

分享到微博請遵守國家法律
株洲市| 进贤县| 日喀则市| 江源县| 玛曲县| 辛集市| 新巴尔虎左旗| 霍林郭勒市| 平阳县| 中卫市| 张家港市| 胶州市| 桃园县| 南郑县| 凤山县| 雷州市| 双城市| 祁门县| 宁远县| 赤城县| 满洲里市| 潮安县| 岑巩县| 石棉县| 平乐县| 湖南省| 铁力市| 巴东县| 安远县| 乐业县| 奈曼旗| 长垣县| 裕民县| 兴化市| 东海县| 平安县| 平陆县| 清流县| 和龙市| 江达县| 门源|