FPEvalRepoPublic/LeetCodeMetaData
0399
1{2 "id": 2819,3 "name": "remove-trailing-zeros-from-a-string",4 "difficulty": "Easy",5 "link": "https://leetcode.com/problems/remove-trailing-zeros-from-a-string/",6 "date": "2023-05-21",7 "task_description": "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.",8 "test_case": [9 {10 "label": "Example 1",11 "input": "num = \"51230100\"",12 "output": "\"512301\" "13 },14 {15 "label": "Example 2",16 "input": "num = \"123\"",17 "output": "\"123\" "18 }19 ],20 "constraints": [21 "1 <= num.length <= 1000",22 "num consists of only digits.",23 "num doesn't have any leading zeros."24 ],25 "python_template": "class Solution(object):\n def removeTrailingZeros(self, num):\n \"\"\"\n :type num: str\n :rtype: str\n \"\"\"\n ",26 "java_template": "class Solution {\n public String removeTrailingZeros(String num) {\n \n }\n}",27 "metadata": {28 "func_name": "removeTrailingZeros"29 }30}