Robot Returns to Origin: Java Solution

Solved a basic but interesting problem: Robot Return to Origin 🤖 In this problem, a robot moves based on given directions (Up, Down, Left, Right). The goal is to check whether the robot comes back to the starting point (0,0) after completing all moves. 👉 Approach: I tracked the movement using x and y coordinates. Left/Right affects x Up/Down affects y If both x and y become 0 at the end, it means the robot returned to origin. Simple logic, but a good reminder that strong basics are very important 💡 #LeetCode #DSA #ProblemSolving #CodingJourney #Java #Stack #Algorithms #Consistency #Learning #Tech

  • graphical user interface, text

To view or add a comment, sign in

Explore content categories