五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

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

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

分享到微博請遵守國家法律
夏河县| 廊坊市| 周宁县| 迁安市| 商都县| 太仓市| 四平市| 怀仁县| 徐闻县| 马关县| 山丹县| 吴江市| 弥勒县| 化州市| 江城| 太康县| 汤阴县| 辰溪县| 驻马店市| 句容市| 井冈山市| 疏附县| 靖远县| 永昌县| 五指山市| 泸定县| 阿瓦提县| 玛纳斯县| 临夏县| 长白| 大同县| 交城县| 民县| 苏州市| 阜南县| 宜章县| 普兰县| 曲靖市| 山西省| 游戏| 康定县|