public int lengthLongestPath(String input) {
        if (input.length() == 0) {
            return 0;
        }
        StringTokenizer tokenizer = new StringTokenizer(input, "\n");
        Queue<Node> queue = new LinkedList<>();
        while (tokenizer.hasMoreTokens()) {
            queue.offer(new Node(tokenizer.nextToken()));
        }
        Node root = new Node("", -1);
        return lengthLongestPath(queue, root, 0);
    }
Find longest absolute path in file system indicated by \n and \t.

Solution 1:
Create queue of file and its level. Then recurse from root towards file. Use level
to decide if next word in queue is in same level (so no more recursion) or next level so
going deep in recursion.

Solution 2(iterative):
Keep pushing elements into stack till you either reach a file with . or a file whose number of tabs is less than
top of stack. If you reach file with extension then update the max. Otherwise keep popping from stack till number of tabs
at top of stack becomes less than current file. Maintain current length during push and pop.

Time complexity O(n)
Space complexity O(n)

https://leetcode.com/problems/longest-absolute-file-path/
src/com/interview/recursion/LongestAbsolutePath.java