🚀 Day 56 of #100DaysOfCode Today’s problem was “Count and Say” from LeetCode, and honestly, it turned out to be a great exercise in understanding patterns and strengthening my fundamentals in strings and iteration. At first glance, the problem looks a bit confusing because of its recursive definition. But once I broke it down, I realized that it’s all about reading the previous result and constructing the next one using run-length encoding (RLE). 🧠 My Approach: I started with the base case: 👉 Count and say(1) = "1" Then for every next step, I: * Traversed the current string * Counted consecutive repeating characters * Built a new string by appending: (count + character) For example: * "1" → "11" (one 1) * "11" → "21" (two 1s) * "21" → "1211" (one 2, one 1) This step-by-step transformation helped me clearly understand how the sequence evolves. 💡 Key Learnings from Today: * Breaking complex problems into smaller steps makes them manageable * String traversal and careful indexing are very important * While loops can be more useful than for loops in pattern-based problems * Edge cases (like last character handling) need extra attention * Writing clean and readable code helps avoid logical mistakes ⚙️ Challenges I Faced: Initially, I struggled with managing the pointer while counting characters and ensuring I don’t skip any element. But after dry-running the code and visualizing the process, everything started making sense. 🔥 What I Improved Today: * Better understanding of pattern-based problems * More confidence in handling strings * Improved logical thinking and debugging skills ✨ This journey is teaching me that consistency beats perfection. Even if the problem feels tricky at first, spending time understanding it deeply always pays off. 📌 Every day I’m getting a little closer to becoming a better problem solver. Let’s keep going 💪 #Day56 #100DaysOfCode #LeetCode #DSA #CodingJourney #ProblemSolving #Cpp #LearnToCode #Consistency #GrowthMindset #Developers #TechJourney
Count and Say Problem on LeetCode with RLE and Pattern-Based Approach
More Relevant Posts
-
The power of vibe coding isn't that the bot does your code homework. It's that you finally have a tutor who never gets tired of your questions...but that means you have to actually learn. If you're building products, you must understand the systems you're engineering with. ...and if you're stacking up a massive backlog of vibe coded work from non-engineers waiting on dev review then you just 10x'd yourself in the wrong direction. #VibeCoding #SoftwareEngineering #ITInfrastructure
To view or add a comment, sign in
-
The bug wasn’t in the code. It was in my thinking. 💡 Another Sunday, another LeetCode contest. I was doing well in the contest and reached 3rd problem with momentum and I got stuck. Instead of focusing on what the problem was actually asking, I started building complex logic in my head. Different cases. Multiple scenarios. Overthinking every possibility. Then the real intuition clicked: Just focus on neighboring elements that break the non-decreasing order and fix only those gaps. Simple. Clean. Effective. ⚡ Sometimes we assume a problem must be complex because it looks difficult. So we search for advanced solutions before understanding the fundamentals. That happens in engineering too: 👉 Overdesigned systems 👉 Unnecessary abstractions 👉 Solving edge cases before the core case 👉 Missing the obvious because we’re chasing the impressive When stuck, ask yourself: “Am I solving the real constraint… or the story I created around it?” That question can save time in contests, coding, and work. Today’s reminder for me: Complexity is sometimes self-inflicted. Simplicity is a skill. #LeetCode #ProblemSolving #SoftwareEngineering #Learning #CodingJourney #GrowthMindset #TechCareers
To view or add a comment, sign in
-
-
350 problems on LeetCode — and the hardest part wasn’t solving them I recently crossed 350 problems on LeetCode. At the start, it felt like a numbers game. Solve more, get better. But somewhere along the way, that idea changed. Because the real progress wasn’t in the count—it was in how I started thinking. Sitting with a problem that made no sense, and choosing not to move on Debugging the same logic again and again until it finally clicked Realizing that most mistakes come from unclear thinking, not lack of knowledge Learning to stay patient when nothing seems to work There were days when even simple problems felt difficult. Days where progress felt invisible. But that’s the part no one talks about. Improvement in problem solving is slow. It’s subtle. You don’t notice it day to day—but one day, things just feel easier. Patterns start repeating—DP, graphs, sliding window, and more. Your approach becomes more structured. And problems that once felt impossible start to feel manageable. The biggest shift wasn’t in skill. It was in mindset. You stop chasing quick answers. You start trusting the process. 350 is just a checkpoint. But it taught me something I’ll carry forward: Progress doesn’t come from motivation. It comes from showing up—even when it feels like you’re getting nowhere. On to the next milestone. #LeetCode #DSA #ProblemSolving #Consistency #GrowthMindset
To view or add a comment, sign in
-
-
400 down, many more to go. 📈 Reaching 400 problems on LeetCode has taught me that software engineering isn't just about writing code—it’s about how you approach a problem when you don't initially know the answer. The stats: ✅ 400 Total Solved ✅ 60.2% Acceptance Rate ✅ Beating 98.5% in consistency/speed The biggest takeaway? Discipline beats motivation every single time. #SoftwareDeveloper #TechMilestones #LeetCode #CodingCommunity #GrowthMindset
To view or add a comment, sign in
-
-
🚀 Day 59 of #100DaysOfCode Today’s problem was Jump Game II, and it turned out to be a great learning experience in understanding how to move from a brute-force mindset to an optimized greedy solution. 🔹 Problem Statement: You are given an array where each element represents the maximum jump length from that position. Starting from index 0, the goal is to reach the last index using the minimum number of jumps. 🔹 Initial Thought (Brute Force): My first instinct was to try all possible jumps from each index using recursion. This approach explores every path to the end and then picks the minimum jumps required. However, this method has a major drawback: * It leads to exponential time complexity * Results in Time Limit Exceeded (TLE) for larger inputs This made it clear that a better, optimized approach was needed. 🔹 Optimized Approach (Greedy): Instead of exploring all possibilities, I learned how to make the best decision at each step using a greedy strategy. The idea is: * Keep track of the farthest index we can reach while traversing * Maintain a current boundary (range) of indices we can explore with the current number of jumps * When we reach the end of this boundary, we increase the jump count and update the boundary to the farthest reachable index This ensures: ✔ Minimum number of jumps ✔ Efficient traversal in a single pass 🔹 Key Variables Used: * farthest→ tracks the maximum reachable index * currEnd→ marks the end of the current jump range * jumps → counts the number of jumps taken 🔹 Time & Space Complexity: ⏱ Time Complexity: O(n) 📦 Space Complexity: O(1) 🔹 Key Learnings from Today: ✨ Greedy algorithms can outperform brute force when decisions can be made locally ✨ Tracking ranges instead of individual paths simplifies the problem ✨ Many array problems are actually about intervals and coverage ✨ Optimization is not always about complex logic—sometimes it’s about observing patterns 🔹 Personal Reflection: Today’s problem reminded me that getting stuck on brute force is okay, but the real growth happens when you step back, rethink, and optimize Each day of this challenge is helping me improve not just my coding skills, but also my problem-solving mindset and ability to think efficiently under constraints. 💯 Consistency > Perfection One step closer to becoming a better developer every single day. #Day59 #100DaysOfCode #DSA #GreedyAlgorithm #LeetCode #CodingJourney #ProblemSolving #Placements #SoftwareDevelopment
To view or add a comment, sign in
-
-
Solved a new problem on LeetCode today and learned something important: Understanding the logic matters more than just writing code. Instead of jumping to solutions, I focused on: • Breaking the problem into smaller parts • Thinking of multiple approaches • Optimizing step by step This approach is helping me improve my problem-solving mindset. #LeetCode #ProblemSolving #DSA #Learning #GrowthMindset
To view or add a comment, sign in
-
🚀 Day 51 of #LeetCode Journey Consistency is starting to feel less like discipline… and more like identity. Today’s focus was on “Merge Strings Alternately” — a simple problem on the surface, but a great reminder of how clean logic and pointer control can make solutions elegant. While solving it, I realized something important about tech: The real growth doesn’t come from solving new problems alone — it comes from revisiting old ones and seeing them differently. So along with today’s challenge, I also went back and practiced previous problems. And honestly? That’s where the real confidence builds. 💡 In tech, repetition isn’t boring — it’s how patterns become instinct. 🔥 Day 51 takeaway: Small problems sharpen big thinking. And consistency quietly compounds into mastery. #100DaysOfCode #LeetCode #DSA #Consistency #CodingJourney #TechGrowth
To view or add a comment, sign in
-
A tip that has always worked for me; take a real project codebase you're working on within your organization, and start getting familiar with it by reading features built by other developers. You'll learn a lot, more than just about coding.. #software #softwaredevelopment #coding #learning
To view or add a comment, sign in
-
Every morning is a fresh start in your coding journey a chance to improve, learn, and build something better than yesterday. Approach your day with focus and confidence. Coding is about solving problems. Errors will come, but each bug you fix makes you stronger and smarter. Stay consistent. Progress may be small, but it adds up over time and shapes you into a better developer. Start today with purpose write, learn, and keep pushing. Every great software began with a single line of code. 💻✨ #Tech #codingLife #Debug #LearnKeepPushing
To view or add a comment, sign in
-
🚀 LeetCode Rating Journey – Road to Improvement Started taking contests seriously, and the journey has been quite a ride so far. Currently sitting at 1272 rating, with a peak that’s slowly climbing again after some dips. 📊 Stats Snapshot: 700+ problems solved Consistent participation in contests (25 attended) Strong focus on Mediums, gradually pushing into Hard territory 📈 What’s Working: Upsolving after every contest (this helped the most) Focusing on patterns instead of random problems Revisiting mistakes and maintaining notes ⚠️ What Needs Improvement: Speed during contests (often running out of time) Better handling of tricky implementation problems More practice on advanced topics (DP, graphs, greedy edge cases) 🎯 Plan Ahead: Solve at least 2–3 quality problems daily Do virtual contests regularly Deep dive into editorials instead of just reading them Strengthen weak areas systematically This is just the beginning. The goal is to break into higher rating brackets step by step 💪 If you’re on a similar journey, consistency really is everything. Let’s keep pushing 🚀 #LeetCode #CompetitiveProgramming #CodingJourney #DSA #Algorithms #CP #ProgrammingLife #CodeDaily #DeveloperJourney #Upskilling #ProblemSolving #TechGrowth #Consistency #KeepGrinding 🚀 Raj Vikramaditya Shumbul Arifa Parikh Jain
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