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
Maximize Robot's Coins in Grid with Robbers
More Relevant Posts
-
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
To view or add a comment, sign in
-
-
🚦 From a broken Raspberry Pi to a working Lane Management system — here's what my capstone project actually looked like. When I started this project, the plan was simple: mount a camera on a TurtleBot3, detect lane markings in real time using YOLOv8, and alert the driver via a mobile app. Reality had other plans. Three weeks before the final deadline, my Raspberry Pi's OS got corrupted and the power supply failed. Hardware gone. Weeks of setup — gone. Most people would pause. So I rebuilt the entire robot in software. I wrote a custom Python simulator that generates a realistic perspective camera view of lane scenarios, streams it over Flask — the exact same endpoints the physical robot would have used. The YOLO detector didn't even know the difference. Here's what the final system looks like: 🔹 Custom TurtleBot simulator → streams live MJPG video at 25 FPS 🔹 YOLOv8n-seg model trained and annotated frames across lane scenarios 🔹 Real-time lane departure detection: IN_LANE, LEFT_DEPARTURE, RIGHT_DEPARTURE, LANE_LOST + more 🔹 Mobile app with color-coded alerts (Green / Yellow / Red) + manual controls via ngrok tunnel Biggest lesson: when hardware fails, your software architecture either saves you or sinks you. Designing the simulator to mirror the real robot's Flask endpoints from day one meant the pivot cost me days, not weeks. This project was built as part of my BCA capstone at VIT. Simulation video's : https://lnkd.in/gMM3G_p6 #MachineLearning #ComputerVision #YOLOv8 #LaneDeparture #AutonomousVehicles #ROS #TurtleBot #Capstone #DeepLearning #Python
To view or add a comment, sign in
-
How to Build a “Crash-Free Invisible Robot” with Python For repetitive tasks like reporting, machine monitoring, and error logging, Python can be used to build a system that runs 24/7 alongside your production line—reading data, detecting changes, and capturing every critical event. In practice, Python becomes a smart observer continuously watching your machines. But here’s the key difference A simple script can crash with a single error. A well-designed system keeps running no matter what. This is where we take inspiration from industrial robots—machines that repeat tasks for hours without crashing. Why? Because they are driven by systems like PLC (Programmable Logic Controller), where everything is executed step-by-step, with strict timing and built-in error handling. If we apply the same mindset to Python: • Design logic as states (step-by-step execution) • Add timeouts to avoid infinite waiting • Handle errors instead of letting them crash the system • Log everything for traceability and optimization • Ensure the system can always recover and continue The result? Your Python code is no longer just a script… It becomes a reliable industrial monitoring system—an “invisible robot” that never gets tired, never crashes, and continuously helps improve your operations. ⸻ #Automation #Python #SmartFactory #IndustrialEngineering #ContinuousImprovement #Reliability #Manufacturing #IIoT #DataDriven
To view or add a comment, sign in
-
-
✅ 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
-
-
Going from writing Python code and problem solving to working with ROS2 robotics is a big change in how you think. Your code is kept in a clean digital box in standard Python scripts. You need to make an architecture in ROS2 that can understand physical space, build systems, and the timing of hardware. I've been digging deep into the ROS2 backend for the past few days, and I finally got to see the math come to life on my screen. -> I made my first ROS2 package from the ground up. Taking the time to learn how colcon build reads package.xml and Python files to make the setup.The bash overlay finally made the "magic" of ROS2 make sense. -> Learned how nodes drop high-speed "best effort" sensor data if they think it will be delivered reliably (QoS). We also learned how to use namespaces and parameter overrides so that two identical sensors, like dual LiDARs, don't try to use the same USB ports. -> This was the big win today: turning spatial math into 3D visualization. I went from simple 2D logic to writing a full Xacro/URDF blueprint for a multi-link robotic arm with a base, three joints, a gripper, and a camera to make a complicated TF Tree. I was able to broadcast the robot using robot_state_publisher, start RViz2, and use joint_state_publisher_gui to move the arm's joints in real time after dealing with a lot of strict syntax rules and file path errors. Going from raw XML code and terminal errors to a moving 3D model makes the steep learning curve entirely worth it. #ROS2 #Robotics #RoboticsEngineering #Python
To view or add a comment, sign in
-
-
Teaching Machines to See in Black & White: Thresholding! 🔳🏁 Day 84/100 In a world of gray areas, sometimes a computer needs a clear 'Yes' or 'No'. 🏗️ For Day 84 of my #100DaysOfCode journey, I tackled Image Thresholding. This is the fundamental process used in QR code scanning and document digitization. By picking a mathematical 'threshold', we can strip away shadows and noise, leaving behind a high contrast binary image that a machine can easily interpret. Technical Highlights: 🔳 Binary Classification: Using np.where to force pixel values into a strict 0 (Black) or 255 (White) state. ⚡ Noise Reduction: Simplifying complex visual data into clean shapes the first step in Optical Character Recognition (OCR). 🧮 Vectorized Decision Making: Implementing conditional logic across entire matrices without the overhead of Python loops. 🔍 Feature Extraction: Understanding how thresholding helps self-driving cars identify lane markings on diverse road surfaces. Do check my GitHub repository here : https://lnkd.in/d9Yi9ZsC #100DaysOfCode #ComputerVision #NumPy #Python #BTech #IILM #AIML #ImageProcessing #SoftwareEngineering #LearningInPublic #WomenInTech
To view or add a comment, sign in
-
-
AI-driven inspection significantly reduces human error and downtime, providing 100% traceability that traditional manual checks simply cannot match. I have open-sourced my latest project: a hybrid YOLO and Mathematical-based vision tool designed to run on standard IP cameras and Python 3.10. Explore the framework here: 👉 https://lnkd.in/dCU_kJbc #IndustrialAutomation #ComputerVision #YOLOv8 #Industry40 #Python #SmartManufacturing #Instrumentation #OpenSource
To view or add a comment, sign in
-
Upgraded the backend architecture for my Naruto Hand-Sign Recognition project. Here's what I changed: - Unified feature extraction across live runtime + prediction API - Added shared signals: landmark distances, angles, motion features - Introduced per-class confidence thresholds for cleaner outputs - Improved prediction stability with stronger decision logic - Preserved custom rule-based Rasengan detection path - Cleaner training pipeline + better debugging visibility Result: more accurate predictions, fewer false triggers, and a stronger base for future jutsu detection. #ComputerVision #MachineLearning #OpenCV #MediaPipe #Python #AI #BackendDevelopment #Naruto #BuildInPublic
To view or add a comment, sign in
-
-
Today, let's talk about two important languages in robotics: Python and C++. In the world of robotics, choosing a language is really about using the right tool for the right job. 🪧 Python has become the cornerstone of robotics for one main reason: speed of thought. When you’re experimenting with complex AI or trying to get a robot to "see" using Computer Vision, Python does it effectively. With libraries like OpenCV and TensorFlow, Python handles the "heavy thinking" (interpreting surroundings and managing high-level logic). System Integration: It connects different subsystems to function as a cohesive whole. 🪧 While Python handles the strategy, C++ handles the execution. When a robot needs to move with precision or react in real-time, there is no substitute for the expertise of C++. Because it’s compiled directly to machine code, C++ is incredibly fast. This is critical for motion control and navigation where every millisecond counts. C++ also gives developers direct access to sensors and actuators, allowing for fine-grained control over motor drivers and embedded systems. 🪧In a practical setup, a developer might use Python to design the "intelligent" perception algorithms and C++ to ensure the robot’s physical movements are reliable and lightning-fast. Happy new week LinkedIn! The ongoing Aurora Robotics workshop, both teaches and gets you certified in your chosen field of robotics. Registration is open till April 23rd, 2026. Apply here: https://lnkd.in/esj2sCCg #AuroraRobotics #RoboticsWorkshop #Python #Cpp #STEMNigeria #Engineering #OpenSource
To view or add a comment, sign in
-
-
Today, let's talk about two important languages in robotics: Python and C++. In the world of robotics, choosing a language is really about using the right tool for the right job. 🪧 Python has become the cornerstone of robotics for one main reason: speed of thought. When you’re experimenting with complex AI or trying to get a robot to "see" using Computer Vision, Python does it effectively. With libraries like OpenCV and TensorFlow, Python handles the "heavy thinking" (interpreting surroundings and managing high-level logic). System Integration: It connects different subsystems to function as a cohesive whole. 🪧 While Python handles the strategy, C++ handles the execution. When a robot needs to move with precision or react in real-time, there is no substitute for the expertise of C++. Because it’s compiled directly to machine code, C++ is incredibly fast. This is critical for motion control and navigation where every millisecond counts. C++ also gives developers direct access to sensors and actuators, allowing for fine-grained control over motor drivers and embedded systems. 🪧In a practical setup, a developer might use Python to design the "intelligent" perception algorithms and C++ to ensure the robot’s physical movements are reliable and lightning-fast. Happy new week LinkedIn! The ongoing Aurora Robotics workshop, both teaches and gets you certified in your chosen field of robotics. Registration is open till April 23rd, 2026. Apply here: https://lnkd.in/eX23Chur #AuroraRobotics #RoboticsWorkshop #Python #Cpp #STEMNigeria #Engineering #OpenSource
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