🚀 Day 68 of #100DaysOfCode Today I worked on Insert Interval (LeetCode #57) — a problem that really tested my ability to think logically and handle edge cases efficiently. Initially, the problem seemed complex because it involves maintaining sorted order while also ensuring no overlapping intervals. But instead of jumping to a complicated solution, I focused on breaking it into smaller, manageable parts. 💡 Approach I followed: * Traversed intervals one by one * Identified three clear scenarios: before, after, and overlapping * Merged intervals only when required instead of over-processing everything This helped me write a clean and efficient solution in C++ with better clarity and readability. 📌 Key Skills Strengthened Today: ✔ Problem decomposition (breaking complex logic into simple steps) ✔ Handling edge cases effectively ✔ Writing clean and maintainable code ✔ Strengthening DSA fundamentals for technical interviews 📈 Why this matters: Problems like these are frequently asked in coding interviews at top tech companies because they test your understanding of arrays, intervals, and logical thinking — not just syntax. 🔥 My takeaway: Consistency is paying off. Every day I’m getting better at identifying patterns instead of memorizing solutions. I’m not just solving problems anymore — I’m learning how to think like a developer. On to Day 69 💪 #Day68 #100DaysOfCode #LeetCode #DSA #SoftwareEngineering #CodingJourney #ProblemSolving #Cplusplus #TechCareers #InterviewPreparation #Developers #LearningInPublic #Consistency #FutureEngineer
100DaysOfCode Day 68: LeetCode #57 Insert Interval
More Relevant Posts
-
100 Leetcode Problems solved. When I started, even “easy” problems felt confusing. I used to jump straight into coding and get stuck more often than not. Over time, I changed my approach. Instead of rushing to solutions, I started focusing on: 🔹breaking problems down before coding 🔹identifying patterns (especially in stacks, arrays, and linked lists) 🔹understanding time & space complexity 🔹learning how to optimize brute force approaches That shift made a big difference. Now, I’m not just solving problems — I’m thinking more like how I would in an interview setting: “How can I explain this clearly?” “Is this the most optimal approach?” “What edge cases am I missing?” 100 is still just the beginning, but it feels good to see progress from where I started. Next goal: improve problem-solving speed + consistency, and keep strengthening core DSA concepts. If you're on the same path — keep going. It’s slow, but it adds up. #LeetCode #DSA #InterviewPrep #ProblemSolving #Java #SoftwareEngineering
To view or add a comment, sign in
-
-
Day-3 of My Coding Journey Today I worked on the LeetCode problem: 👉 Find Numbers with Even Number of Digits What I learned: How to count digits in a number using String.valueOf(num).length() How to check if a number has even digits using % 2 == 0 ❌ My Mistake: I wrote: String.value(num).length % 2 == 0 ✔ Issues: Used value() instead of valueOf() Forgot () in length ✅ Fix: String.valueOf(num).length() % 2 == 0 After correcting this, my solution got Accepted! ✨ Takeaway: Small syntax mistakes can cause errors, but fixing them improves attention to detail and strengthens fundamentals. #Day3 #LeetCode #Java #CodingJourney #Learning 10000 Coders
To view or add a comment, sign in
-
-
🚀 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
-
🚀 Day 7 of LeetCode Problem Solving Solved today’s problem — LeetCode #414: Third Maximum Number 💻🔥 ✅ Approach: Tracking Top 3 Maximums ⚡ Time Complexity: O(n) 📊 Space Complexity: O(1) The challenge was to find the third distinct maximum number in an array. If it doesn’t exist, return the maximum number. 👉 Instead of sorting (which takes extra time), I tracked the top 3 distinct maximum values in a single pass. 💡 Key Idea: Maintain three variables (max, smax, tmax) to store the first, second, and third maximum values while traversing the array. 👉 Core Logic: Skip duplicates Update max, second max, third max accordingly If third max doesn’t exist → return max 💡 Key Learning: Optimizing from sorting to a single-pass solution can significantly improve efficiency. Grateful to my mentor Pulkit Aggarwal — your guidance is helping me think more optimally 🙌 Consistency is the key — improving step by step 🚀 #Day7 #LeetCode #DSA #Java #CodingJourney #ProblemSolving #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 10 of My LeetCode Journey — Mastering Linked Lists Today’s problems: 🔹 Middle of the Linked List (LeetCode 876) 🔹 Reverse Linked List (LeetCode 206) 💡 Problem 1: Middle of the Linked List Used the classic slow & fast pointer approach: 👉 Slow moves 1 step 👉 Fast moves 2 steps 👉 When fast reaches the end → slow is at the middle 🎯 Such a simple trick, yet super powerful! 💡 Problem 2: Reverse Linked List This one is a must-know 🔥 👉 Iteratively reverse pointers 👉 Keep track of prev, current, and next 👉 Flip links step by step Also explored how this can be done using recursion 🧠 What I Learned: Two-pointer techniques are extremely useful Pointer manipulation builds real confidence in DSA Linked Lists are all about careful handling of references 🔥 Key Takeaways: Small tricks (like slow/fast pointers) can simplify problems a lot Practicing core problems like reversing a linked list is essential for interviews Understanding the logic > memorizing code Grateful for the learning journey with Namaste DSA and Akshay Saini 🚀 🙌 Day 11 loading… 💪 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #LinkedList #ReverseLinkedList #TwoPointers #NamasteDSA
To view or add a comment, sign in
-
#100DaysOfLeetcode journey 🚀 Day 66/100 — Thinking in Circles! Today’s Problem: 2515. Shortest Distance to Target String in a Circular Array 🔹 The Goal: Find the shortest path between a starting index and a target string in an array that "wraps around" at the ends. You can move either clockwise or counter-clockwise. 🔹 The Insight: This is a beautiful exercise in Radial Geometry applied to a 1D structure. When you connect the ends of an array, the distance between any two points $i$ and $j$ isn't just $|i - j|$. There's a hidden path that goes through the "boundary" of the array. The shortest path is always the minimum of the direct linear distance and the "complement" distance ($N - \text{Linear Distance}$). 🔹 The Logic: Single Pass Scan: Instead of complex BFS, we just need to identify where the target lives. Dual-Distance Logic: For every match found, we evaluate the two possible routes: The "Standard" route (staying within the array bounds). The "Circular" route (jumping from index 0 to $N-1$ or vice versa). Constant Space: The entire check happens in $O(N)$ time with $O(1)$ memory. ✨ Achievement: Day 66! Moving from complex bitwise validation and string parsing into circular array logic. It’s a great reminder that understanding the topology of your data structure (whether it's a line, a circle, or a grid) is the first step toward optimization. 🔍 Steps followed: ✔ Linear Traversal: Evaluated every potential target location. ✔ Modular Arithmetic: Simplified circular transitions using absolute differences. ✔ Optimal Minimum: Tracked the global minimum across all valid occurrences. 🔧 Complexity Analysis: Time Complexity: $O(n)$ Space Complexity: $O(1)$ 66 days down! The finish line is coming into focus. Let’s keep the momentum! 🛠️ #Java #DSA #LeetCode #CodingJourney #100DaysOfCode #SoftwareEngineer #InternshipBound #Programming #ArrayAlgorithms #CircularArrays #Optimization #Day66
To view or add a comment, sign in
-
-
🚀 Day 561 of #750DaysOfCode 🚀 📌 Problem: Minimum Distance to the Target Element Today’s problem was simple yet a great reminder of how powerful basic iteration can be when applied correctly. 🔍 The task was to find the minimum distance between a given start index and any index i such that nums[i] == target. 💡 Key Insight: Instead of overthinking, just iterate through the array and track the minimum value of |i - start| whenever the target is found. Clean, efficient, and effective. 🧠 What I Learned: Sometimes brute force with clarity is the best solution Always look for opportunities to minimize operations with simple logic Writing clean and readable code matters as much as solving the problem ⚡ Approach: Traverse the array Check for target Update minimum distance ⏱️ Complexity: Time: O(n) Space: O(1) 💻 Consistency is key. Small steps every day build strong problem-solving skills over time. #leetcode #dsa #programming #java #coding #developers #softwareengineering #100daysofcode #codingjourney #tech #learning #growth
To view or add a comment, sign in
-
-
💻 Master the basics of programming with Conditions (If, Else, Switch)! Understanding how decisions work in code is the foundation of building smart and dynamic applications. 🚀 ✔️ if → Runs when condition is true ✔️ else → Runs when condition is false ✔️ switch → Handles multiple cases efficiently Start coding smarter, not harder! 💡 📚 Learn with Iifetech Pvt Ltd and level up your skills today. #ProgrammingBasics #CodingForBeginners #LearnCoding #JavaScript #WebDevelopment #TechEducation #CodingLife #DeveloperJourney #IfElse #SwitchCase #ProgrammingLogic #CodeSmart #LearnWithIifetech #TechSkills #FutureDevelopers #SoftwareDevelopment #CodingTips #ITTraining #DigitalSkills #LearnTech
To view or add a comment, sign in
-
-
🚀 Day 8 of LeetCode Problem Solving Solved today’s problem — LeetCode #66: Plus One 💻🔥 ✅ Approach: Digit Manipulation ⚡ Time Complexity: O(n) 📊 Space Complexity: O(1) (excluding output) The problem was about incrementing a large integer represented as an array of digits. 👉 Instead of converting it into a number, I handled it digit by digit from the end — just like how we do addition manually. 💡 Key Idea: Start from the last digit and handle carry: If digit < 9 → simply increment and return If digit == 9 → make it 0 and carry forward 👉 Edge Case: If all digits are 9 (like [9,9,9]), we need a new array → [1,0,0,0] 💡 Key Learning: Understanding how basic operations work internally (like addition) helps in solving array-based problems efficiently. Grateful to my mentor Pulkit Aggarwal — your guidance is helping me strengthen my fundamentals every day 🙌 Consistency is the key — showing up daily 🚀 #Day8 #LeetCode #DSA #Java #CodingJourney #ProblemSolving #100DaysOfCode
To view or add a comment, sign in
-
-
#100DaysOfLeetcode journey 🚀 🚀 Day 73/100 — Budgeting Increments with Sliding Windows! Today’s Problem: 1838. Frequency of the Most Frequent Element 🔹 The Goal: Maximize the frequency of any element in an array by increasing other elements. You have a "budget" of $k$ total increments. 🔹 The Insight: This is a classic Sorting + Sliding Window challenge. By sorting the data, we ensure that elements that require the least work to become identical are grouped together. The problem then shifts from a search for "which value" to a search for "how wide a window" can we afford. 🔹 The Logic: The Cost Equation: For any window ending at right, the cost to make everything equal to nums[right] is simply $(Value \times Size) - \text{Total Sum}$. Greedy Expansion: We keep expanding the right pointer and adding to our window sum. Dynamic Contraction: The moment our "cost to equalize" exceeds our budget $k$, we shrink the window from the left until it’s affordable again. Efficiency: This allows us to find the global maximum frequency in a single linear sweep after sorting. ✨ Achievement: Day 73! We're deep into the final 30% of the challenge. Moving from prefix-sum coordinate math to these dynamic-cost sliding windows is refining my ability to handle optimization problems with multiple constraints. 🔍 Steps followed: ✔ Sort & Proximity: Grouped similar values to minimize increment costs. ✔ Long-Precision Math: Used long to prevent overflow when calculating window areas. ✔ Linear Synchronization: Implemented the two-pointer sweep for an efficient $O(N \log N)$ total runtime. 🔧 The Stats: Time Complexity: $O(n \log n)$ Space Complexity: $O(1)$ 73 days down! The logic is getting faster and the solutions are getting cleaner. Let’s keep going! 🛠️ #Java #DSA #LeetCode #CodingJourney #100DaysOfCode #SoftwareEngineer #InternshipBound #Programming #SlidingWindow #Sorting #Optimization #Day73
To view or add a comment, sign in
-
Explore related topics
- Approaches to Array Problem Solving for Coding Interviews
- Problem Solving Techniques for Developers
- Why Use Coding Platforms Like LeetCode for Job Prep
- Prioritizing Problem-Solving Skills in Coding Interviews
- Leetcode Problem Solving Strategies
- Tips for Coding Interview Preparation
- LeetCode Array Problem Solving Techniques
- Tips to Navigate the Developer Interview Process
- Tips for Problem-Solving with Clarity
- Build Problem-Solving Skills With Daily Coding
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