Skip to content

Commit 4fe9097

Browse files
committed
fix: remove trailing spaces and add newline at EOF
1 parent 7b298c0 commit 4fe9097

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

ValidParentheses.java

Whitespace-only changes.

src/main/java/com/thealgorithms/stacks/ValidParentheses.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@
66

77
/**
88
* Valid Parentheses Problem
9-
*
9+
*
1010
* Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
1111
* determine if the input string is valid.
12-
*
12+
*
1313
* An input string is valid if:
1414
* 1. Open brackets must be closed by the same type of brackets.
1515
* 2. Open brackets must be closed in the correct order.
1616
* 3. Every close bracket has a corresponding open bracket of the same type.
17-
*
17+
*
1818
* Examples:
1919
* Input: "()"
2020
* Output: true
21-
*
21+
*
2222
* Input: "()[]{}"
2323
* Output: true
24-
*
24+
*
2525
* Input: "(]"
2626
* Output: false
27-
*
27+
*
2828
* Input: "([)]"
2929
* Output: false
30-
*
30+
*
3131
* @author Gokul45-45
3232
*/
3333
public final class ValidParentheses {
@@ -71,4 +71,4 @@ public static boolean isValid(String s) {
7171
// Stack should be empty if all brackets are matched
7272
return stack.isEmpty();
7373
}
74-
}
74+
}

src/test/java/com/thealgorithms/stacks/ValidParenthesesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ void testNullAndOddLength() {
2929
assertFalse(ValidParentheses.isValid(null));
3030
assertFalse(ValidParentheses.isValid("(()"));
3131
}
32-
}
32+
}

0 commit comments

Comments
 (0)