Leetcode 0020. Valid Parentheses

Posted on Mon 02 December 2024 in Leetcode • Tagged with stack, parentheses

Question Link : https://leetcode.com/problems/valid-parentheses/

Difficulty: Easy

Premium: False

Question

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if:

Open brackets must be closed by the same type of brackets. Open brackets must be closed …


Continue reading

Leetcode 0224. Basic Calculator

Posted on Sun 20 November 2022 in Leetcode • Tagged with calculator, parentheses

Question Link : https://leetcode.com/problems/basic-calculator/

Difficulty: Hard

Question

Given a string s representing a valid expression, implement a basic calculator to evaluate it, and return the result of the evaluation. Note: You are not allowed to use any built-in function which evaluates strings as mathematical expressions, such as …


Continue reading

Leetcode 1249. Minimum Remove to Make Valid Parentheses

Posted on Mon 14 March 2022 in Leetcode • Tagged with stack, parentheses

Question Link : https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/

Difficulty: Medium

Question

Given a string s of '(' , ')' and lowercase English characters. Your task is to remove the minimum number of parentheses ( '(' or ')', in any positions ) so that the resulting parentheses string is valid and return any valid string. Formally, a parentheses string …


Continue reading