TheRealSamuel/LeetCodeProblem
0564
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 00:00:00",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 "public_test_cases": [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 "private_test_cases": [21 {22 "input": "697530628828869803136441264184780828792169984376501085146074525279154469088573531713959371695137076980364082329318569589350452492847925526511762512791409484801096001801034629457629453409881780694334014562272399499050505518046505709311199289449824927379094967026234945967860122386880041907015304756322123822606485423887168394581828706043093287877604186277287134817761317466599795002977920142870565956527851968383019562246389030602159947684612061714428984314787813948792477574114229286682586044287445993580955501004192443839088855862305376552537660330300950008243068681713486598374658959546659943838161781240630504902017658457885704511608229755975044591843767564694394002164901271442528581772145501745112687848273552828693727043287630930320408753553456005755850677539654708225909343781458031312677265705352443329037005711952423385324649764903826",23 "output": "697530628828869803136441264184780828792169984376501085146074525279154469088573531713959371695137076980364082329318569589350452492847925526511762512791409484801096001801034629457629453409881780694334014562272399499050505518046505709311199289449824927379094967026234945967860122386880041907015304756322123822606485423887168394581828706043093287877604186277287134817761317466599795002977920142870565956527851968383019562246389030602159947684612061714428984314787813948792477574114229286682586044287445993580955501004192443839088855862305376552537660330300950008243068681713486598374658959546659943838161781240630504902017658457885704511608229755975044591843767564694394002164901271442528581772145501745112687848273552828693727043287630930320408753553456005755850677539654708225909343781458031312677265705352443329037005711952423385324649764903826"24 },25 {26 "input": "25264410628881446038637256311455435318271149502521315805820709022073737276054746683125641665238599445445495459069671434815474622748859576975412337337287046981835356894335552279742807327367154024251598193532772476143074807492452383515722951998862",27 "output": "25264410628881446038637256311455435318271149502521315805820709022073737276054746683125641665238599445445495459069671434815474622748859576975412337337287046981835356894335552279742807327367154024251598193532772476143074807492452383515722951998862"28 },29 {30 "input": "562340783104644831449127863177560622574143985731762226442133813716011531995705838135284199381505121243806967398506820579693902861246031265402542019566656508932408195752869677337882799912659756942079680145643158497988252345621183620928372490066644622951805882800659309413049441542926938750972979407797992723646999945051872780256123386988546882740884490612381285744264095838761590300531058914423027563162131965057224599242612879833548628952609910844052125844924450145935793871482167229287019452938045468160622585106064455776951185744812134334587789538545239831918753384492958185223785813379524704946094043567983192728940576221614187323751382737310556951880193629000",31 "output": "562340783104644831449127863177560622574143985731762226442133813716011531995705838135284199381505121243806967398506820579693902861246031265402542019566656508932408195752869677337882799912659756942079680145643158497988252345621183620928372490066644622951805882800659309413049441542926938750972979407797992723646999945051872780256123386988546882740884490612381285744264095838761590300531058914423027563162131965057224599242612879833548628952609910844052125844924450145935793871482167229287019452938045468160622585106064455776951185744812134334587789538545239831918753384492958185223785813379524704946094043567983192728940576221614187323751382737310556951880193629"32 },33 {34 "input": "31354259000",35 "output": "31354259"36 },37 {38 "input": "175268620380428996398318616814084447530947067495892171784067010554582990344509293003134978703099813389321131256046333465509048857358353126757074078074938772296711322977216557378471587239475875836818902867997043428165063970813631041511546124401319522254865697970411727635914018414016280848414140778207315967695177374498765848880640806205754981989804261087765039100579296799147079792997721677670715918446612214090010046355980536576785282401364025924344578968925566745421040219119682",39 "output": "175268620380428996398318616814084447530947067495892171784067010554582990344509293003134978703099813389321131256046333465509048857358353126757074078074938772296711322977216557378471587239475875836818902867997043428165063970813631041511546124401319522254865697970411727635914018414016280848414140778207315967695177374498765848880640806205754981989804261087765039100579296799147079792997721677670715918446612214090010046355980536576785282401364025924344578968925566745421040219119682"40 }41 ],42 "haskell_template": "removeTrailingZeros :: String -> String\nremoveTrailingZeros num ",43 "ocaml_template": "let removeTrailingZeros (num: string) : string = ",44 "scala_template": "def removeTrailingZeros(num: String): String = { \n \n}",45 "java_template": "class Solution {\n public String removeTrailingZeros(String num) {\n \n }\n}",46 "python_template": "class Solution(object):\n def removeTrailingZeros(self, num):\n \"\"\"\n :type num: str\n :rtype: str\n \"\"\"\n "47}