LeetCode 1022: Sum of Root To Leaf Binary Numbers in Java

🚀 Day 97 of #100DaysOfCode Solved LeetCode #1022 – Sum of Root To Leaf Binary Numbers ✅ A neat blend of DFS traversal and binary math, turning root-to-leaf paths into numbers. Key Takeaways: -> DFS with an accumulated binary value -> Using left shift (num * 2) to build numbers efficiently -> Correctly identifying leaf nodes for the final sum -> Simple recursion, strong fundamentals 🌳➡️🔢 Language: Java -> Runtime: 0 ms (Beats 100%) ⚡ -> Memory: 43.76 MB Consistency wins. Almost at the finish line 💻🔥 #LeetCode #Java #BinaryTree #DFS #Recursion #BitManipulation #ProblemSolving #100DaysOfCode

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories