Skip to content

Commit

Permalink
Resolving the annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
iamwatchdogs authored Oct 29, 2023
1 parent 38118d5 commit be3b2b4
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions Solved-Problems/Backspace_String_Compare/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,33 @@ public static boolean backspaceCompare(String s, String t) {
Stack<Character> s1 = new Stack<Character>();
Stack<Character> s2 = new Stack<Character>();

for(char ch : s.toCharArray()) {
if(ch == '#'){
if(!s1.isEmpty())
for (char ch : s.toCharArray()) {
if (ch == '#') {
if (!s1.isEmpty()) {
s1.pop();
}
continue;
}
s1.push(ch);
}

for(char ch : t.toCharArray()) {
if(ch == '#'){
if(!s2.isEmpty())
for (char ch : t.toCharArray()) {
if (ch == '#') {
if (!s2.isEmpty()) {
s2.pop();
continue;
}
s2.push(ch);
continue;
}
s2.push(ch);
}

String res1 = "";
String res2 = "";

while(!s1.isEmpty())
while (!s1.isEmpty())

Check warning on line 31 in Solved-Problems/Backspace_String_Compare/Main.java

View workflow job for this annotation

GitHub Actions / java-linter / java-linter

[reviewdog] reported by reviewdog 🐶 'while' construct must use '{}'s. Raw Output: /github/workspace/./Solved-Problems/Backspace_String_Compare/Main.java:31:5: warning: 'while' construct must use '{}'s. (com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck)
res1 += s1.pop();

while(!s2.isEmpty())
while (!s2.isEmpty())

Check warning on line 34 in Solved-Problems/Backspace_String_Compare/Main.java

View workflow job for this annotation

GitHub Actions / java-linter / java-linter

[reviewdog] reported by reviewdog 🐶 'while' construct must use '{}'s. Raw Output: /github/workspace/./Solved-Problems/Backspace_String_Compare/Main.java:34:5: warning: 'while' construct must use '{}'s. (com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck)
res2 += s2.pop();

return res1.equals(res2);
Expand Down

0 comments on commit be3b2b4

Please sign in to comment.