Robot Returns to Origin: LeetCode 657

🚀 Day 553 of #750DaysOfCode 🚀 🤖 LeetCode 657: Robot Return to Origin Today’s problem was simple yet a great reminder of how powerful basic logic can be. 📌 Problem Summary: A robot starts at (0,0) and follows a sequence of moves: 'U' → Up 'D' → Down 'L' → Left 'R' → Right 👉 Goal: Check whether the robot returns back to the origin after all moves. 💡 Approach: Instead of overthinking, I focused on tracking movement on axes: Vertical → U cancels D Horizontal → L cancels R If both balances are zero → back to origin ✅ 🧠 Key Insight: This problem is not about simulation, but about balance. ⚡ Complexity: Time → O(n) Space → O(1) 🎯 Takeaway: Even easy problems strengthen your fundamentals. Consistency > Complexity 💯 🔥 553 days down, 197 to go! Let’s keep building 🚀 #LeetCode #Java #DSA #CodingJourney #Consistency #ProblemSolving #Developers #100DaysOfCode #Tech

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories