Skip to content

Commit 30bb70a

Browse files
authored
Update balanced-paranthesis.js
1 parent 6d0c0c7 commit 30bb70a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

balanced-paranthesis.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
const balancedParanthesis = (N, paranthesis = [], openCount, closedCount) => {
2-
if (
3-
closedCount > openCount ||
4-
paranthesis.length > 2 * N ||
5-
openCount > N ||
6-
closedCount > N
7-
) {
2+
if (closedCount > openCount || openCount > N || closedCount > N) {
83
return;
94
}
105
if (paranthesis.length === 2 * N) {
@@ -21,4 +16,3 @@ const balancedParanthesis = (N, paranthesis = [], openCount, closedCount) => {
2116

2217
const N = 3;
2318
balancedParanthesis(N, [], 0, 0);
24-

0 commit comments

Comments
 (0)