LeetCode POTD 💫: Description: There is a robot starting at the position (0, 0), the origin, on a 2D plane. Given a sequence of its moves, judge if this robot ends up at (0, 0) after it completes its moves. You are given a string moves that represents the move sequence of the robot where moves[i] represents its ith move. Valid moves are 'R' (right), 'L' (left), 'U' (up), and 'D' (down). Return true if the robot returns to the origin after it finishes all of its moves, or false otherwise. Note: The way that the robot is "facing" is irrelevant. 'R' will always make the robot move to the right once, 'L' will always make it move left, etc. Also, assume that the magnitude of the robot's movement is the same for each move. Here's my solution: https://lnkd.in/gkXEWXtP #Python #DSA #Leetcode #DailyChallenge #Easy
Robot Returns to Origin After Moves
More Relevant Posts
-
✅ Day 93 of 100 Days LeetCode Challenge Problem: 🔹 #657 – Robot Return to Origin 🔗 https://lnkd.in/gfZBi3XR Learning Journey: 🔹 Today’s problem involved tracking movements of a robot on a 2D plane. 🔹 I used a dictionary to map each move to its coordinate change: • 'U' → +1 (y-axis) • 'D' → -1 (y-axis) • 'R' → +1 (x-axis) • 'L' → -1 (x-axis) 🔹 Maintained a coordinate array ans = [0, 0] representing (x, y). 🔹 Iterated through each move and updated the respective axis. 🔹 Finally checked whether the robot returned to the origin [0, 0]. Concepts Used: 🔹 Coordinate Simulation 🔹 HashMap / Dictionary 🔹 String Traversal Key Insight: 🔹 The robot returns to origin only if horizontal and vertical movements cancel out. 🔹 Net displacement in both x and y directions must be zero. Complexity: 🔹 Time: O(n) 🔹 Space: O(1) #LeetCode #Algorithms #DataStructures #CodingInterview #100DaysOfCode #Python #ProblemSolving #LearningInPublic #TechCareers
To view or add a comment, sign in
-
-
Gemini Robotics-ER 1.6, In this video, Move from theory to real coding and show how to run the API on your PC using Python. I cover basic setup, how the model understands images and gives coordinates, how it can write and run code to analyze things like gauges, and how it breaks down tasks like a robot “brain.” ⚠️ This is still in preview, so results may vary always use safety checks before connecting to real robots. Try it yourself using the Gemini API docs and AI Studio. Do check out my Youtube channel : https://lnkd.in/gZbzm-dR Check it out: Docs https://lnkd.in/gredDXJK #GeminiRobotics #GoogleDeepMind #AI #Robotics #EmbodiedAI
To view or add a comment, sign in
-
Robot vibe coding is a thing now. In this video, I’m not writing a single line of robot code myself. Instead, I’m using an AI Copilot inside VSCode to generate and refine a complete robot program - just by describing what I want. This is built on top of our NOVA SDK, using Python, VSCode and NVIDIA Omniverse as the environment. Which means: all the recent AI coding advances suddenly apply to robotics as well. But here’s what really surprised me: The Copilot doesn’t just generate code. It actually understands robotics problems and how to solve them for me. Singularities. Velocity limits. Out-of-reach targets. It interprets the SDK’s planning error messages, creates sub-programs to search for solutions, and iterates towards a working solution. So now I’m wondering: If this keeps improving at the current pace - will we all be vibe coding robots sooner than we think?
To view or add a comment, sign in
-
Impressive to see what is already possible today and hard to imagine what will be achievable in the years ahead. Good thing we’re already prepared with Nova OS and software-defined automation 🤭
Robot vibe coding is a thing now. In this video, I’m not writing a single line of robot code myself. Instead, I’m using an AI Copilot inside VSCode to generate and refine a complete robot program - just by describing what I want. This is built on top of our NOVA SDK, using Python, VSCode and NVIDIA Omniverse as the environment. Which means: all the recent AI coding advances suddenly apply to robotics as well. But here’s what really surprised me: The Copilot doesn’t just generate code. It actually understands robotics problems and how to solve them for me. Singularities. Velocity limits. Out-of-reach targets. It interprets the SDK’s planning error messages, creates sub-programs to search for solutions, and iterates towards a working solution. So now I’m wondering: If this keeps improving at the current pace - will we all be vibe coding robots sooner than we think?
To view or add a comment, sign in
-
Seeing this in action was a powerful reminder: robotics is entering its software era. With Software Defined Robotics, teams can move faster from idea to deployment, iterate continuously, and cut time to market for real robotic workloads. That’s exactly what Wandelbots Nova is built for — bringing modern software workflows to automation, and making robotics more adaptable, scalable, and future-ready.
Robot vibe coding is a thing now. In this video, I’m not writing a single line of robot code myself. Instead, I’m using an AI Copilot inside VSCode to generate and refine a complete robot program - just by describing what I want. This is built on top of our NOVA SDK, using Python, VSCode and NVIDIA Omniverse as the environment. Which means: all the recent AI coding advances suddenly apply to robotics as well. But here’s what really surprised me: The Copilot doesn’t just generate code. It actually understands robotics problems and how to solve them for me. Singularities. Velocity limits. Out-of-reach targets. It interprets the SDK’s planning error messages, creates sub-programs to search for solutions, and iterates towards a working solution. So now I’m wondering: If this keeps improving at the current pace - will we all be vibe coding robots sooner than we think?
To view or add a comment, sign in
-
LeetCode POTD 💫: Description: You are given an m x n grid. A robot starts at the top-left corner of the grid (0, 0) and wants to reach the bottom-right corner (m - 1, n - 1). The robot can move either right or down at any point in time. The grid contains a value coins[i][j] in each cell: -> If coins[i][j] >= 0, the robot gains that many coins. -> If coins[i][j] < 0, the robot encounters a robber, and the robber steals the absolute value of coins[i][j] coins. The robot has a special ability to neutralize robbers in at most 2 cells on its path, preventing them from stealing coins in those cells. Note: The robot's total coins can be negative. Return the maximum profit the robot can gain on the route. Here's my solution: https://lnkd.in/gQVFQaPD #Python #DSA #Leetcode #DailyChallenge #DP
To view or add a comment, sign in
-
-
Work in progress from our IBM AI Racing League project. We’re building a Python autonomous driver for TORCS, using telemetry from each lap to tune braking, racing lines, and segment-level speed targets on the Corkscrew track. This screenshot shows the simulator running alongside our live driver logs — speed, track position, lap time, and controller state are all being captured for post-lap analysis. Current focus: making the fastest lap repeatable while keeping it clean through the kink, S-turn, and final hairpin. Tech stack: Python, TORCS, VS Code, telemetry analysis, IBM SkillsBuild / Granite-assisted development. #IBMSkillsBuild #IBMAIRacingLeague #Python #AI #AutonomousDriving #Telemetry #TORCS
To view or add a comment, sign in
-
-
Just solved LeetCode 657: Robot Return to Origin and it’s a great reminder that clean, fundamental thinking often beats over-engineering. The Problem: Given a string of moves (U, D, L, R), determine if a robot starting at (0,0) returns to the origin after executing all commands. My Approach: Coordinate Tracking Simulation Instead of reaching for complex data structures, I simply tracked position: • x → horizontal (R = +1, L = -1) • y → vertical (U = +1, D = -1) • Return true if x == 0 && y == 0 Time: O(n) | Space: O(1) Key Insight: Opposite moves cancel each other out. If count(U) == count(D) and count(L) == count(R), the robot must return home. Sometimes a quick count beats step-by-step simulation! This pattern (coordinate tracking + cancellation logic) is foundational for grid problems, path simulations, and even early-stage BFS/DFS intuition. Mastering the basics makes medium problems feel much more approachable. #LeetCode #Algorithms #CodingInterview #SoftwareEngineering #Python #ProblemSolving #TechCareers #DataStructures
To view or add a comment, sign in
-
-
Turning ideas into real-time AI solutions! Developed a Vehicle Detection & Real-time Traffic Monitoring System using YOLOv8 that works with: ✔ Automated vehicle detection from webcam & uploaded videos ✔ Count cars, bikes, buses, and trucks ✔ Display live analytics with a clean UI It intelligently detects and counts vehicles with high accuracy. Key Benefits: 🔹Helps reduce traffic congestion 🔹Reduces manual effort 🔹Improve road safety 🔹Scalable for smart city applications Tech Stack: Python | OpenCV | YOLOv8 | Streamlit #AI #ComputerVision #YOLO #Python #MachineLearning #DeepLearning #AIProjects
To view or add a comment, sign in
-
LeetCode POTD 💫: Description: There are n 1-indexed robots, each having a position on a line, health, and movement direction. You are given 0-indexed integer arrays positions, healths, and a string directions (directions[i] is either 'L' for left or 'R' for right). All integers in positions are unique. All robots start moving on the line simultaneously at the same speed in their given directions. If two robots ever share the same position while moving, they will collide. If two robots collide, the robot with lower health is removed from the line, and the health of the other robot decreases by one. The surviving robot continues in the same direction it was going. If both robots have the same health, they are both removed from the line. Your task is to determine the health of the robots that survive the collisions, in the same order that the robots were given, i.e. final health of robot 1 (if survived), final health of robot 2 (if survived), and so on. If there are no survivors, return an empty array. Return an array containing the health of the remaining robots (in the order they were given in the input), after no further collisions can occur. Note: The positions may be unsorted. Here's my solution: https://lnkd.in/gr_iruSp #Python #DSA #Leetcode #DailyChallenge #Hard
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development