Nice solution! It's all about counting the height. No need to hashing.

public List<List<Integer>> findLeaves(TreeNode root) { List<List<Integer>> res = new ArrayList<>(); T(res,root); return res; } private int T(List<List<Integer>>res, TreeNode root){ if(root==null)return -1; int height = Math.max(T(res,root.left),T(res,root.right))+1; if(height==res.size()){res.add(new LinkedList<Integer>());} res.get(height).add(root.val); return height; }Find Leaves of Binary Tree