🚀 #100DaysOfCode – Day 10 Consistency is kicking in. Small wins adding up 🔥 ✅ What I accomplished today: 🧠 LeetCode Problem – Robot Collisions 📌 Problem Overview: Given robots with positions, health, and directions (L or R), simulate collisions: Robots moving toward each other collide The robot with lower health gets destroyed If equal → both destroyed Survivors continue moving 💡 My Approach (Sorting + Stack Simulation): 🔹 Sorted robots based on positions to process collisions in order 🔹 Used a stack to track right-moving robots 🔹 When a left-moving robot appears → simulate collisions with stack top 🔹 Carefully handled 3 cases: ✔ Smaller health → robot destroyed ✔ Greater health → reduce health & continue ✔ Equal health → both destroyed 🔹 Stored original indices to return result in correct order ⚡ Time Complexity: O(n log n) (sorting + single pass) ⚡ Space Complexity: O(n) 🧩 Key Insight: This problem helped me understand: ✔ How to convert simulation problems into stack-based solutions ✔ Importance of sorting before processing interactions ✔ Handling multiple collision scenarios cleanly ✔ Writing state-driven logic without brute force 🔗 LeetCode Submission Link: https://lnkd.in/gKGk8GFM ☕ Spring Boot Learning – Revision + Concepts 🔹 Revised all previously learned concepts to strengthen fundamentals 🔹 Learned the difference between: 📌 PUT vs PATCH ✔ PUT → Updates the entire resource (full replacement) ✔ PATCH → Updates only specific fields (partial update) 📌 H2 Database (In-Memory DB): ✔ Runs in memory → data is lost after application restart ✔ Useful for testing & development ✔ Not suitable for persistent production data 📌 Key Takeaways: ✔ Use PUT when updating full objects ✔ Use PATCH for partial updates (better performance) ✔ H2 is great for testing, but not for long-term storage ✔ Revision is as important as learning new things 📝 Spring Boot Notes: https://lnkd.in/gNZWz96m 🔥 Learning Streak: Day 10/100 Double digits now. Staying consistent 💪 #100DaysOfCode #Java #SpringBoot #BackendDevelopment #LeetCode #DSA #CodingJourney #ProblemSolving #SoftwareDevelopment #LearningInPublic #Developers #Consistency #BuildInPublic
100 Days of Code: LeetCode Robot Collisions
More Relevant Posts
-
Day 46/60 — Building a Production-Ready Workflow ⚙️🐳 Today was a major build day for my automation project, AutomataOps. After getting Docker running, I didn’t stop there — I pushed further to make the system more structured and closer to real-world deployment. 🔧 What I implemented: Refactored the application for cleaner architecture Centralized configuration using environment variables Added a .dockerignore file for optimized builds Introduced Docker Compose for simplified container orchestration Successfully ran the system using a fully containerized workflow 💡 Key lesson: It’s one thing to run an application. It’s another thing to design it so it can: run consistently scale easily be managed cleanly ⚙️ Breakthrough moment: Running: docker compose up --build …and seeing the system process tasks correctly inside a containerized environment felt like a real step into production-level thinking. 🚀 What this means: AutomataOps is no longer just a local script. It is now: containerized environment-aware orchestrated We’re not just writing code anymore… We’re building systems that can actually be deployed. #DevOps #Docker #Automation #Python #CloudComputing #BuildInPublic
To view or add a comment, sign in
-
-
Six production apps shipped this quarter. But I don't know how to code in any modern language. Some background: I'm the "PC guy." For almost three decades, I've been wrestling hardware and keeping complex production and research operations alive, from additive manufacturing systems to advanced metrology. I'm the guy who figures it out. My programming history is dusty: BASIC on a C64, FORTRAN, COBOL, and PLC ladder logic. Nothing modern. Nothing ever shipped. That wall I was staring at for thirty years just had a door in it. My company rolled out AI Wingmate. Then GitHub Copilot. I was in for both, early. New tool shows up, I want to know what it can do before anyone tells me what it's for. Wingmate helps me plan, but Copilot fills in the "how" when I already know the "what." Deep domain knowledge, the true IP, is the core programming language. Copilot is simply the interpreter. I don't pick projects. I notice them. Scaffolding a new process, a workaround someone's been doing for years. A report that takes three hours and should take three minutes. A manual step nobody's questioned in a decade. I see the end use case and use AI to build the fix. Every tool I ship is a standalone Windows executable, reviewed against my company's internal standards. I set a goal to ship 3 apps in 2026. It's the end of Q1, and I'm already at 6 and counting. This is what the Future Process Engineer looks like: deep domain knowledge plus AI-assisted development. The gate isn't skill. It's identity. You either decide you're someone who builds, or you keep walking past the problem. So, what persistent problem in your plant, your lab, or your office have you watched people work around for years? Build it. Wingmates: look me up in the GAL or ping me on Teams. I'll help you get started. Everyone else: comment if you can. DMs open if it's something you can't post publicly. #FutureProcessEngineer #ProcessEngineering #AerospaceManufacturing #GitHubCopilot
To view or add a comment, sign in
-
🚀 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
To view or add a comment, sign in
-
-
🔥 Day 554 of #750DaysofCode 🔥 🚀 Problem Solved: Walking Robot Simulation Today’s problem tested my simulation + hashing skills in a really interesting way! 🤖 What I implemented: I simulated the robot’s movement step-by-step on an infinite grid while handling obstacles efficiently. 💡 Instead of using complex structures, I used: 👉 HashSet to store blocked positions 👉 Direction array to manage movement (N, E, S, W) 🧠 Core Idea: Maintain current direction using an index Rotate: Right → (dir + 1) % 4 Left → (dir + 3) % 4 Move one step at a time (very important 🚨) Before every step: Check if next position is blocked If yes → stop moving for that command ⚡ Key Insight: 👉 You cannot jump directly k steps 👉 You MUST move step-by-step to correctly detect obstacles 💻 My Approach: ✔️ Stored obstacles as "x,y" in HashSet ✔️ Used direction vector: North → (0,1) East → (1,0) South → (0,-1) West → (-1,0) ✔️ Tracked max distance using: 👉 x² + y² 📈 Complexity: Time: O(N + total steps) Space: O(M) for obstacles 🎯 What I learned: Simulation problems require careful step execution Hashing makes obstacle lookup super fast Small implementation details can make or break the solution 💬 Honestly, this problem looks easy at first, but handling directions + obstacles correctly makes it a great practice problem! #Day554 #750DaysOfCode #LeetCode #Java #DSA #CodingJourney #ProblemSolving #Developers #Tech
To view or add a comment, sign in
-
-
From monoliths to microservices, we’ve spent years optimising systems for scalability and performance, but now the biggest gains are coming from how we write code itself. #AI #GenerativeAI #ClaudeAI #SoftwareEngineering #DeveloperProductivity #DevTools #Programming #Automation #AICoding #FutureOfWork
To view or add a comment, sign in
-
🚀 Day 555 of #750DaysOfCode 🚀 🧠 Today’s Problem: Walking Robot Simulation II (LeetCode - Medium) This problem was all about simulation + optimization. At first glance, it looks like a simple movement problem, but the tricky part is handling direction changes at boundaries efficiently. 💡 Key Insights: The robot moves along the perimeter of the grid. Instead of simulating every step (which could be up to 10⁵), we optimize using: 👉 perimeter = 2*(width - 1) + 2*(height - 1) We reduce steps using modulo: 👉 num %= perimeter Then simulate movement in chunks based on current direction. ⚙️ What I implemented: Maintained (x, y) position and current direction Handled boundary collisions → turn 90° counterclockwise Efficient movement without iterating step-by-step 🔥 Learning Takeaways: Simulation problems often hide optimization opportunities Always look for patterns (like cycles/perimeters) Clean direction handling makes logic much easier 💻 Tech Used: Java, OOP, Simulation Logic Consistency > Motivation. Showing up every day 💪 #LeetCode #Java #ProblemSolving #DataStructures #Algorithms #CodingJourney #Consistency
To view or add a comment, sign in
-
-
13+ Coding Theory Tools in One Dashboard! 🧑🎓 This is the first of two posts about my latest project. Today, I’m sharing the results; in the next one, I’ll dive into the DevOps infrastructure that keeps it running with zero manual effort. I’ve built an interactive Coding Theory Toolbox featuring 13+ algorithms, including: - Error Correction: Elias Code, Companion Codes, Hamming logic. - Data Compression: Huffman, Shannon-Fano, Entropy analysis. - Data Encoding: BCD (with custom weights), Gray Code, and more. Whether it's visualising bit-flips in a parity matrix or calculating information entropy, I wanted to turn dry theory into a hands-on developer experience. ✨ Check it out live: https://lnkd.in/dhnhzzG8 💻 Explore the code: https://lnkd.in/deHuVVku Stay tuned for Part 2, where I’ll share how I automated the infrastructure! #SoftwareEngineering #CodingTheory #OpenSource #WebDev
To view or add a comment, sign in
-
-
Built a skill that scaffolds production ready repos, not just code but the entire setup. Architecture docs, diagrams, CI CD, Dockerfile, .env.example, Makefile, CONTRIBUTING all generated in one go based on what you ask. It adapts to intent small ask → minimal code bigger ask → complete repo ready to use Open source. Plug it into your workflow as a .skill file. https://lnkd.in/gEgZJWYx #skills #ai #agents #claude #bob #tech
To view or add a comment, sign in
-
Week 1 Complete: I’m officially a Prompt Engineer. Five days ago, I embarked on a journey to transition from "chatting" with AI to "engineering" it. Here is my final takeaway: Prompt Engineering is not just about crafting the perfect sentence; it’s about establishing a predictable workflow. My 3-Step Full-Stack Workflow: 1. The Architect Phase: I utilize Chain-of-Thought to plan the logic and data flow before writing any code. 2. The Builder Phase: I apply the RCCF Framework along with Few-Shot examples to generate code that aligns with my existing project structure. 3. The Auditor Phase: I implement Negative Prompting to instruct the AI on what to avoid (such as bugs, security flaws, and high latency) and have it "peer-review" its own work. The outcome? Faster sprints, cleaner pull requests, and significantly reduced time spent on boilerplate. What's next? This "Learn With Me" series is just beginning. I plan to explore System Design or Docker & Chaos Engineering next (referencing my SrujanScale project). Which topic should I tackle for Week 2? A) System Design & Microservices B) CI/CD & Dockerization C) Advanced Python for Automation I welcome your input in the comments. Thank you for joining me on this journey through Week 1. #PromptEngineering #SoftwareEngineering #CareerGrowth #FullStack #Java #SpringBoot #AI #LearnWithMe #Day5 #WeeklyWrapUp
To view or add a comment, sign in
-
Unleash the power of loops in your code! 🚀🔁 Loops are essential tools that allow you to repeat a block of code multiple times. For developers, mastering loops is crucial for automating tasks, processing arrays, and managing large amounts of data efficiently. Now, let's dive into the step-by-step breakdown: 1️⃣ Declare a variable to store the number of times you want to loop. 2️⃣ Use a for loop to iterate through the code block until the specified condition is met. 3️⃣ Finally, execute the code block inside the loop to perform the desired actions. 👉 Pro Tip: Keep an eye on loop counters to prevent infinite loops that can crash your program! 💡 Common Mistake Alert: Forgetting to update loop variables can lead to infinite looping. Always ensure your loop has a clear exit condition! 🤔 Question: What's your favorite use case for loops in your projects? Share below! 🌐 View my full portfolio and more dev resources at tharindunipun.lk #LoopsInCode #DevelopersGuide #Coding101 #MasterTheLoop #Automation #CodeEfficiency #ProgrammingTips #TechTalk #AlwaysLearning
To view or add a comment, sign in
-
Explore related topics
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