LeetCode – Longest Absolute File Path (Java)

https://leetcode.com/problems/longest-absolute-file-path/ Java Solution 1 class Node{ int level; int len; public Node(int lev, int len){ this.level = lev; this.len = len; } }   public class Solution { public int lengthLongestPath(String input) { if(input==null||input.length()==0) return 0;   int max=0;   String[] arr = input.split("\n");   Stack<Node> stack = new Stack<Node>();   for(int i=0; i<arr.length; i++){ … Read more