public List<String> binaryTreePaths(TreeNode root) {
List<String> res = new ArrayList<>();
Queue<TreeNode> queue = new LinkedList<>();
Queue<String> path = new LinkedList<>();
while (!queue.isEmpty()) {
for (int i = 0; i < size; i++) {
TreeNode curNode = queue.remove();
String curPath = path.remove();
if (curNode.left == null && curNode.right == null) {
res.add(curPath + curNode.val);
if (curNode.left != null) {
path.add(curPath + curNode.val + "->");
if (curNode.right != null) {
queue.add(curNode.right);
path.add(curPath + curNode.val + "->");