8000 update 71 · githubniraj/Leetcode@ed07b96 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

src/main/java/com/fishercoder/solutions/_71.java

Lines changed: 2 additions & 0 deletions
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)
0