@@ -0,0 +1,914 @@
+package leetcode.simplify_path;%0A%0Aimport java.util.Stack;%0A%0Apublic class Solution %7B%0A    public String simplifyPath(String path) %7B%0A    %09String%5B%5D components = path.split(%22/%22);%0A    %09Stack%3CString%3E dirStack = new Stack%3CString%3E();%0A    %09for(String component : components)%7B%0A    %09%09if(component.length() == 0) continue;%0A    %09%09if(component.equals(%22.%22)) continue;%0A    %09%09if(component.equals(%22..%22))%7B%0A    %09%09%09if(!dirStack.isEmpty())%7B%0A    %09%09%09%09dirStack.pop();%0A    %09%09%09%7D%0A    %09%09%7Delse%7B%0A    %09%09%09dirStack.push(component);%0A    %09%09%7D%0A    %09%7D%0A    %09StringBuilder ans = new StringBuilder(%22/%22);%0A    %09String prefix = %22%22;%0A    %09for(String component : dirStack)%7B%0A    %09%09ans.append(prefix);%0A    %09%09ans.append(component);%0A    %09%09prefix = %22/%22;%0A    %09%7D%0A    %09return ans.toString();%0A    %7D%0A    public static void main(String%5B%5D args)%7B%0A    %09System.err.println(new Solution().simplifyPath(%22/home/ckclark/helloaaa/a/.../../../../././../ckclark/../../../../%22));%0A    %7D%0A%7D%0A

Add java solution for 71. Simplify Path