Refactor almost everything

This commit is contained in:
Arkaprabha Chakraborty
2022-08-02 12:21:43 +05:30
parent ccc376aea0
commit cab1180397
39 changed files with 117 additions and 54 deletions

View File

@@ -2,7 +2,7 @@ class Solution {
public int longestValidParentheses(String str) {
Stack<Integer> stack = new Stack<>();
stack.push(-1);
int max = 0;
for (int cur = 0; cur < str.length(); cur++) {
if (str.charAt(cur) == '(') {

View File

@@ -2,7 +2,7 @@
#include <string>
class Solution {
public:
public:
int longestValidParentheses(std::string line) {
std::stack<int> shelf;
shelf.push(-1);