BAEL-3481 - modified as per Editor Review comments.
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ import java.util.LinkedList;
|
||||
public class BalancedBracketsUsingDeque {
|
||||
|
||||
public boolean isBalanced(String str) {
|
||||
if (null == str || str.length() == 0 || ((str.length() % 2) != 0)) {
|
||||
if (null == str || ((str.length() % 2) != 0)) {
|
||||
return false;
|
||||
} else {
|
||||
char[] ch = str.toCharArray();
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package com.baeldung.algorithms.balancedbrackets;
|
||||
public class BalancedBracketsUsingString {
|
||||
|
||||
public boolean isBalanced(String str) {
|
||||
if (null == str || str.length() == 0 || ((str.length() % 2) != 0)) {
|
||||
if (null == str || ((str.length() % 2) != 0)) {
|
||||
return false;
|
||||
} else {
|
||||
char[] ch = str.toCharArray();
|
||||
|
||||
Reference in New Issue
Block a user