🚀 Day 4 of My LeetCode Journey — Building Problem-Solving Muscle Today I worked on two problems: 🔹 Max Consecutive Ones (LeetCode 485) 🔹 Missing Number (LeetCode 268) 💡 Problem 1: Max Consecutive Ones This problem is all about pattern recognition. 👉 Traverse the array 👉 Keep counting consecutive 1s 👉 Reset when you hit 0 Simple logic, but a great reminder that not every problem needs complex data structures. 💡 Problem 2: Missing Number This one was interesting — multiple ways to solve it: ✔️ Sorting ✔️ HashSet ✔️ XOR ✔️ Sum formula (most optimal) The cleanest approach: 👉 Use the formula: n * (n + 1) / 2 👉 Subtract the actual sum 👉 Boom — missing number found ⚡ 🔥 Key Takeaways from Today: Not every problem needs brute force There’s always a more optimal way — look for patterns Understanding multiple approaches = stronger fundamentals Consistency is slowly turning confusion into clarity 💪 On to Day 5 🚀 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #Consistency #CodeNewbie #DailyCoding
Sanjeev Kumar’s Post
More Relevant Posts
-
🚀 Day 3 of My LeetCode Journey — Consistency > Motivation Today’s problem: Merge Sorted Array (LeetCode 88) At first glance, it looks simple — just merge two arrays, right? But the real challenge is doing it in-place without extra space 🤯 💡 Key Learning: Instead of merging from the front (which causes overwriting), the optimal approach is to: 👉 Use two pointers from the end 👉 Fill the array backwards This small shift in thinking makes a huge difference: ⏱️ Time Complexity: O(m + n) 📦 Space Complexity: O(1) 🔥 What I’m realizing: It’s not about solving problems — it’s about learning how to think differently Every problem is teaching me: How to optimize How to avoid brute force How to think like an interviewer On to Day 4 💪 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #Consistency #CodeDaily
To view or add a comment, sign in
-
🚀 A Major Update is Coming to CodeAlive (Live in 3–4 Days!) I honestly started CodeAlive as a small platform with a simple goal in mind — to let my code snippets live over the internet with support for custom sharable links. But seeing how far it has come now, evolving into a platform with so many useful and smart features for everyone, has been incredibly exciting. 🌐 CodeAlive – https://lnkd.in/gnthhf_b 👉 Also, you can click "View My Website" on my profile to visit the platform. What’s Coming Next ⏭️ CodeAlive is soon introducing: **Multi-Language Detection & Highlighting in a Single Code File** Problem: Almost every code-sharing platforms and online editors are built around one assumption: 1 File = 1 Language But real-world development is rarely that simple. Developers often share: ✅ Frontend + Backend snippets together ✅ Embedded scripts/styles ✅ Configurations with code ✅ Multi-language examples in one paste And when platforms force a single language highlight, readability suffers. With This New Update, CodeAlive Will Support ✅ Detecting multiple languages within one pasted code file ✅ Highlighting different sections based on actual context/language ✅ Making mixed-language snippets cleaner, smarter, and easier to read This has been one of the most exciting features to work on so far, and I can’t wait to share the full implementation details once it officially goes live. 📅 Expected Release: 3–4 Days Stay tuned 👀 More technical insights coming soon... #CodeAlive #BuildInPublic #Programming #SoftwareDevelopment #DeveloperTools #WebDevelopment #Python #JavaScript #StartupJourney
To view or add a comment, sign in
-
-
🚀 Day 24 of My Coding Journey — Power of Two Today’s problem was “Power of Two” — a simple-looking question that really highlights the beauty of bit manipulation. 🔍 What I learned: Instead of using loops or recursion, I explored how binary representation works. A power of two always has only one set bit (1) in its binary form — and that insight leads to a super efficient solution. 💡 Key trick: n & (n - 1) === 0 This removes the lowest set bit, and if the result is zero, the number is a power of two. ⚡ Takeaway: Sometimes the most optimized solutions come from understanding how data is represented internally, not just from writing more code. 📈 Progress: Day by day, I'm getting more comfortable with problem-solving patterns and thinking beyond brute force approaches. #128DaysOfCode #LeetCode #JavaScript #CodingJourney #ProblemSolving #BitManipulation
To view or add a comment, sign in
-
-
🚀 Day 7 of My LeetCode Journey — Sorting Fundamentals Today I focused on two classic sorting algorithms: 🔹 Bubble Sort 🔹 Selection Sort 💡 Bubble Sort The idea is simple: 👉 Compare adjacent elements 👉 Swap if they are in the wrong order 👉 Repeat until the array is sorted It’s easy to understand, but not efficient for large datasets. ⏱️ Time Complexity: O(n²) 💡 Selection Sort A slightly different approach: 👉 Find the minimum element 👉 Place it at the correct position 👉 Repeat for the rest of the array Also simple, but still not optimal for big inputs. ⏱️ Time Complexity: O(n²) 🔥 Key Takeaways: These algorithms may not be optimal, but they build strong fundamentals Understanding how sorting works internally is more important than memorizing Optimization comes later — basics come first Big thanks to Namaste DSA and Akshay Saini 🚀 for guiding this journey Consistency is the real win — Day 8 loading 💪 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #Sorting #BubbleSort #SelectionSort #NamasteDSA
To view or add a comment, sign in
-
Day#17 💡Cracked LeetCode #202 – Happy Number! Ever wondered if a number can be happy? 😄 Turns out, in programming… it can! 🔍 Problem Statement: A number is called Happy if: You replace the number by the sum of the squares of its digits Repeat the process If it eventually becomes 1 → it's a Happy Number If it falls into a loop → Not Happy ❌ 🧠 Key Insight: This problem is not about math… it's about cycle detection! We keep transforming the number: 👉 If we reach 1 → Done ✅ 👉 If we revisit a number → Loop detected 🔁 Approaches: 1️⃣ Using HashSet Store visited numbers Detect loop easily Time: O(log n), Space: O(log n) 2️⃣ Floyd’s Cycle Detection (Fast & Slow Pointer) 🚀 Same concept as Linked List cycle No extra space needed Time: O(log n), Space: O(1) 💻 JavaScript Code (Floyd’s Approach): var isHappy = function(n) { const getNext = (num) => { let sum = 0; while (num > 0) { let digit = num % 10; sum += digit * digit; num = Math.floor(num / 10); } return sum; }; let slow = n; let fast = getNext(n); while (fast !== 1 && slow !== fast) { slow = getNext(slow); fast = getNext(getNext(fast)); } return fast === 1; }; 🔥 What I Learned: Cycle detection isn’t just for linked lists Mathematical problems often hide pattern recognition Always think: Can this loop forever? 📌 Example: 19 → 82 → 68 → 100 → 1 ✅ (Happy Number) #LeetCode #DSA #ProblemSolving #CodingInterview #JavaScript
To view or add a comment, sign in
-
🚀 Day 12 of My LeetCode Journey — Linked List Patterns Getting Stronger Today’s problems: 🔹 Intersection of Two Linked Lists (LeetCode 160) 🔹 Remove Linked List Elements (LeetCode 203) 💡 Problem 1: Intersection of Two Linked Lists Explored two approaches: ✅ Brute Force Traverse headA and check every node in headB ⏱️ Time: O(m × n) ✅ Using Set Store all nodes of headB in a Set Traverse headA and check for intersection ⏱️ Time: O(m + n) | 📦 Space: O(n) 👉 Helped me understand how hashing can optimize comparisons. 💡 Problem 2: Remove Linked List Elements Solved using a Sentinel (Dummy) Node 🔥 👉 Create a dummy node before head 👉 Use prev pointer to skip unwanted nodes: prev.next = prev.next.next This approach simplifies edge cases like: Removing head node Multiple consecutive deletions 🧠 What I Learned: Sentinel nodes make linked list problems cleaner Hashing can reduce time complexity significantly Thinking in terms of nodes (not values) is key 🔥 Key Takeaways: Always look for ways to reduce nested loops Dummy nodes = lifesaver in linked list problems Practice is making pointer manipulation more intuitive Grateful for the guidance from Namaste DSA and Akshay Saini 🚀 Day 13 loading… 💪 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #LinkedList #DSA #NamasteDSA #AkshaySaini
To view or add a comment, sign in
-
Coding agents generate code like there is no tomorrow. Soon enough, they struggle under the weight of what they created. AI writes a new helper instead of reusing an existing one. Old functions stay around because tests still call them, even though production does not. The codebase grows, but the agent's ability to reason about it does not. On bigger projects, especially ones that have been heavily vibe-coded, this turns into chaos. The problem is not just messy code. It is slower reviews, weaker trust in the codebase, and agents that get less reliable as the surface area grows. We have put a lot of energy into making code generation faster. I think the next thing to get right is safe code removal. There is a reason senior engineers get excited about deleting code. It is a bit like never throwing away clothes you no longer wear. It seems fine at first. Then one day, you have five versions of everything, and finding what you actually need means digging through closets you forgot existed. I built a Claude Code skill to help with this. It gives Claude a methodology for dead code removal: classify what you are looking at, verify the cases static tools miss, and avoid drifting into refactor territory while you are in there. It is tuned for Python and TypeScript, but should be easy to adapt. Clone it, fork it, open a PR if you improve it. https://lnkd.in/ds5AcC5U #CodingAgents #CodeQuality
To view or add a comment, sign in
-
Mastering Linear Logic Day 243 Today Today is day 243 of my coding journey, and I am continuing to refine my expertise in the Two Pointer technique. This strategy is a game-changer for linear data structures because it allows for efficient searching and comparison without the need for nested loops, keeping the time complexity at $O(n)$. Two Pointer Core Logic The core idea relies on using two indices to traverse an array or string from different positions. While it usually requires a sorted array, its power lies in three main patterns: Opposite Direction: Pointers start at each end and move toward the center (e.g., Palindrome checks). Same Direction: Fast and slow pointers help detect cycles or find middle elements. Sliding Window: Pointers track a range or subarray that expands and contracts based on constraints. Today's Solved Problems I focused on problems that involve comparison and searching pairs within sorted structures: LeetCode 125 Valid Palindrome: Used pointers at both ends to compare characters while ignoring non-alphanumeric symbols. LeetCode 344 Reverse String: Implemented an in-place swap using two pointers to achieve $O(1)$ space complexity. LeetCode 977 Squares of a Sorted Array: Leveraged the fact that the largest squares are at the ends of a sorted array containing negative numbers. LeetCode 167 Two Sum II: Since the array is already sorted, I used two pointers to narrow down the target sum in a single pass. LeetCode 408 Valid Word Abbreviation: A complex case where I synchronized pointers between a word and its compressed version, handling multi-digit jumps. Logic Tip: In the "3 Sum" problem, the strategy is to fix one pointer and then use the two-pointer technique on the remaining part of the array to find the missing pair. #DSAinJavaScript #365daysOfCoding #JavaScriptLogic #TwoPointers #LeetCodeDaily #ProblemSolving #Algorithms #DataStructures #CodingLife #LogicBuilding #CleanCode #JSDeveloper #WebDevelopment #ProgrammingJourney #SoftwareEngineering #TechLearning #MERNStack #DailyCoding #BackendLogic #CodingCommunity
To view or add a comment, sign in
-
🚀 Day 8 of My LeetCode Journey — Divide & Conquer Today’s problem: Sort an Array (LeetCode 912) 💡 Approach: Merge Sort (Recursive) Instead of using built-in sorting, I implemented a recursive solution using the Divide & Conquer technique. 👉 Break the array into halves 👉 Recursively sort each half 👉 Merge the sorted halves using a helper function Creating a separate merge function to combine two sorted arrays made the logic clean and modular. 🧠 What I Learned: Recursion becomes powerful when combined with Divide & Conquer Breaking problems into smaller pieces simplifies complex logic Writing helper functions improves code readability and reuse ⚡ Complexity: ⏱️ Time: O(n log n) 📦 Space: O(n) 🔥 This problem felt like a step up from basic sorting (Bubble/Selection). Understanding how efficient sorting actually works under the hood was a great experience. Thanks to Namaste DSA and Akshay Saini 🚀 for the guidance Day 9 loading… 💪 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #MergeSort #Recursion #DivideAndConquer #NamasteDSA
To view or add a comment, sign in
-
🚀 Mastering a Classic Algorithm: Balanced Parentheses (Stack – LIFO) Today I revisited a fundamental problem that every Software Engineer should understand: validating balanced parentheses using a stack. Why it matters: This pattern appears in compilers, interpreters, and even real-world applications like expression parsing. Here’s the idea: 👉 Use a stack (LIFO) 👉 Push opening brackets 👉 Pop and match when encountering closing brackets 👉 Ensure the stack is empty at the end Clean and efficient JavaScript implementation 👇 This is a great reminder that mastering data structures like stacks is key to solving real algorithmic problems efficiently. I’m currently building and documenting algorithm patterns here: 🔗 https://lnkd.in/ej4fNeZs #SoftwareEngineering #JavaScript #Algorithms #DataStructures #Coding #LeetCode #100DaysOfCode
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