CoolFace
Datasetpublic

FPEvalDataset/LeetCodeProblem

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes305downloads
1{2    "id": 3445,3    "name": "lexicographically_minimum_string_after_removing_stars",4    "difficulty": "Medium",5    "link": "https://leetcode.com/problems/lexicographically-minimum-string-after-removing-stars/",6    "date": "2024-05-26 00:00:00",7    "task_description": "You are given a string `s`. It may contain any number of `'*'` characters. Your task is to remove all `'*'` characters. While there is a `'*'`, do the following operation: Delete the leftmost `'*'` and the **smallest** non-`'*'` character to its _left_. If there are several smallest characters, you can delete any of them. Return the lexicographically smallest resulting string after removing all `'*'` characters. **Example 1:** **Input:** s = \"aaba*\" **Output:** \"aab\" **Explanation:** We should delete one of the `'a'` characters with `'*'`. If we choose `s[3]`, `s` becomes the lexicographically smallest. **Example 2:** **Input:** s = \"abc\" **Output:** \"abc\" **Explanation:** There is no `'*'` in the string. **Constraints:** `1 <= s.length <= 105` `s` consists only of lowercase English letters and `'*'`. The input is generated such that it is possible to delete all `'*'` characters.",8    "public_test_cases": [9        {10            "label": "Example 1",11            "input": "s = \"aaba*\"",12            "output": "\"aab\" "13        },14        {15            "label": "Example 2",16            "input": "s = \"abc\"",17            "output": "\"abc\" "18        }19    ],20    "private_test_cases": [21        {22            "input": "em*wg*f**ybr*l*pab*qibci**lb*a*iem**fa*hdovwy*azsxhmnldzu**vy*chsph**mrpcspuiykrgeevj*n***c*",23            "output": "wyrpqiilimhovwyzsxhmnlzuvyhspmrpspuiykrvjn"24        },25        {26            "input": "***v**tn**yz*ue*posifv**x*b*p****vskqa*zt*s***uo*nt*iaod**d",27            "output": "zvxvztutiod"28        },29        {30            "input": "*eu*i*crro****pdthvkhfmb*cgrqdimoujhvszay**wjwo",31            "output": "updthvkhfmgrqdimoujhvszywjwo"32        },33        {34            "input": "ydmb*****vxtav*",35            "output": "vxtv"36        },37        {38            "input": "ehonlvmymghwllsifhqtogjtfqywhmaafqeywuweabozqlx",39            "output": "ehonlvmymghwllsifhqtogjtfqywhmaafqeywuweabozqlx"40        }41    ],42    "haskell_template": "clearStars :: String -> String\nclearStars s ",43    "ocaml_template": "let clearStars (s: string) : string =  ",44    "scala_template": "def clearStars(s: String): String = { \n    \n}",45    "java_template": "class Solution {\n    public String clearStars(String s) {\n        \n    }\n}",46    "python_template": "class Solution(object):\n    def clearStars(self, s):\n        \"\"\"\n        :type s: str\n        :rtype: str\n        \"\"\"\n        "47}