Simply Simple Python Solution - with comments
\ndef minRemoveToMakeValid(self, s: str) -> str:\n        status_dict = {}\n        stack = []\n       \n        # keep indexe\'s status in status_dict. If a pa
```\ndef minRemoveToMakeValid(self, s: str) -> str:\n        status_dict = {}\n        stack = []\n       \n        # keep indexe\'s status in status_dict. If a parenthesis is valid\n        # mark it as True else False. use stack to check it\'s validity\n        for idx, ch in enumerate(s):\n            if ch == "(":\n                stack.append(idx)\n            elif ch == ")" and len(stack) > 0:\n                    status_dict[idx] = True\n                    status_dict[stack[-1]] = True\n                    stack.pop()\n       \n        res = []\n        for idx, ch in enumerate(s):\n            if ch == "(" or ch == ")":\n                if idx in status_dict: # only append the parenthesis which are valid\n                    res.append(ch)\n            else:\n                res.append(ch)\n       \n        return "".join(res)\n```
['Python', 'Python3']