Skip to content

Commit ed07b96

Browse files
update 71
1 parent b561f4b commit ed07b96

File tree

1 file changed

+2
-0
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+2
-0
lines changed

Diff for: src/main/java/com/fishercoder/solutions/_71.java

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public String simplifyPath(String path) {
3333
public static class Solution2 {
3434
/**
3535
* This solution doesn't vary too much from the above one, except in that it's using pollLast() and addLast() instead of pop() and push().
36+
* Key notes:
37+
* if using pollLast, then it must be consistent across all calls, including peekLast() and addLast(), cannot mix with pop() and push(), otherwise, unexpected/undesired results will happen.
3638
*/
3739
public String simplifyPath(String path) {
3840
Set<String> skip = new HashSet(Arrays.asList("..", ".", ""));

0 commit comments

Comments
 (0)