🚀 Day 13 of My Coding Journey Today I worked on an interesting problem: 527 Valid Word Abbreviation 💡 👉 The challenge was to check whether a given abbreviation correctly represents a word. It involved handling: Character matching ✅ Skipping characters using numbers 🔢 Edge cases like leading zeros ❌ 💻 Key Logic I Used: Two pointers (i for word, j for abbreviation) If characters match → move both pointers If digit found → build number and skip characters in word If invalid case → return false ✨ Code Snippet: class Solution { public: bool validWordAbbreviation(string word, string abbr) { int i=0, j=0; while(i<word.size() && j<abbr.size()) { if(abbr[j]=='0') return false; if(word[i]==abbr[j]) { i++; j++; } else if(isalpha(abbr[j])) return false; else { int num=0; while(j<abbr.size() && isdigit(abbr[j])) { num = (num*10) + (abbr[j]-'0'); j++; } i += num; } } return i==word.size() && j==abbr.size(); } }; 🧠 What I Learned: How to efficiently parse strings with mixed characters & numbers Importance of handling edge cases like "01" ❗ Two-pointer technique is 🔥 for string problems 📌 Consistency > Perfection See you tomorrow with Day 14! 💪 #100DaysOfCode #DSA #Cpp #CodingJourney #LeetCode #ProblemSolving
Valid Word Abbreviation Challenge with Two Pointers
More Relevant Posts
-
Claude Code has been taking notes on me. Build commands I use, mistakes it made, my coding patterns. Type /memory, then 'Open auto-memory folder'. Plain markdown files. It's been doing this automatically. It's called auto-memory. Claude writes notes to itself when it learns something useful. Next session, it loads them and doesn't repeat the same mistakes. /memory also shows your user memory (~/.claude/CLAUDE.md) and project memory (./CLAUDE.md). You write CLAUDE.md to guide Claude. Claude writes auto-memory to guide itself. Both load at session start, both are plain markdown you can edit. /memory to see it all.
To view or add a comment, sign in
-
- SOLID Principles – Super Simple Explanation (Beginner Friendly) If you're new to coding, think of SOLID as simple rules to keep your code clean and easy to manage 👇 🔹 S – Single Responsibility 👉 One class = one job Example: Keep login logic separate from UI 🔹 O – Open/Closed 👉 Add new features without changing old code Example: Add a new payment type using a new class 🔹 L – Liskov Substitution 👉 Child class should work perfectly in place of parent 🔹 I – Interface Segregation 👉 Don’t force unnecessary methods Example: Use small, focused interfaces 🔹 D – Dependency Inversion 👉 Depend on abstraction, not direct implementation 💡 Real tip: While coding, just ask: “Can I extend this without breaking it?” Start with Single Responsibility — it’s the easiest and most powerful 💯 #SOLID #CleanCode #BeginnerFriendly #Coding
To view or add a comment, sign in
-
Wait, so my user agents write code for me, I cache certain things into a knowledge graph, and ocassionally ask for cross file refactoring, and ocassionally ask an agent to implement something new I've read about in a blog? And thats coding in 2026?
To view or add a comment, sign in
-
I have been using code completion tools since the early 2000s. The jump from autocomplete to Copilot to agentic coding is the biggest shift I have seen in how I actually work — not in speed, but in what the job actually is. I documented that evolution: what changed at each step, what the failure patterns look like (including a running log), and where I think the skill is shifting to. The role now feels less like being an author and more like reviewing a junior's code. The bottleneck is no longer typing; it is knowing what to ask for and recognising when the result is wrong. Article + failure pattern log: https://lnkd.in/edRzw3Ek
To view or add a comment, sign in
-
🚀 Day 55 – 100 Days Coding Challenge 📌 Problem: Convert Number to English Words ⚙️ Approach • Break the number into chunks of 3 digits (hundreds) using modulo and division • Process each chunk separately and map it with its corresponding scale (Thousand, Million, Billion) • Use helper arrays for: – Numbers below 20 – Tens (20, 30, …, 90) – Scale values (Thousand, Million, etc.) • For each chunk: – Convert hundreds place – Handle tens and units • Concatenate all parts in the correct order to form the final string 🧠 Logic Used • Mathematical decomposition (splitting number into base-1000 chunks) • String construction using mapping arrays • Handling edge cases like zero and trailing spaces • Modular and reusable helper function for clean conversion 🔗 GitHub: https://lnkd.in/g_3x55n8 ✅ Day 55 Completed #100DaysOfCode #Java #DSA #ProblemSolving #Algorithms #DataStructures #LeetCode #CodingPractice #Strings #MathLogic
To view or add a comment, sign in
-
-
🔹 Starting LeetCode Series? These Techniques You Must Know When solving problems on LeetCode, knowing the right technique can save a lot of time and effort. Some important techniques every beginner should know: • Two Pointer • Sliding Window • Prefix Sum • Binary Search Continuing this series, today I explored 👇 🔸 Sliding Window Technique 🔹 What is it? It is used to process a fixed or variable size window (subarray/substring) that slides over the data. 🔹 When to use it? Subarray or substring problems Fixed or variable window size Problems involving maximum/minimum sum or length 🔹 Why is it important? Instead of recalculating values again and again, it helps optimize the solution from O(n²) to O(n). 🔹 Key Learning Rather than checking all possible subarrays, maintaining a window and updating it dynamically makes the approach much more efficient. More techniques to explore next 🚀 #LeetCode #DSA #Coding #ProblemSolving #Learning
To view or add a comment, sign in
-
-
🚀 Day 8 / 50 – Wild Coding Kickoff Contest Today’s problem: Plus One (LeetCode #66) Problem Summary: You’re given a number in the form of an array. Each element represents a digit. The goal is simple — add 1 to the number and return the updated array. Example 1: Input: digits = [1,2,3] Output: [1,2,4] Explanation: The array represents the integer 123. Incrementing by one gives 123 + 1 = 124. Thus, the result should be [1,2,4]. Example 2: Input: digits = [9] Output: [1,0] Explanation: The array represents the integer 9. Incrementing by one gives 9 + 1 = 10. Thus, the result should be [1,0]. Approach (from code): Traverse the array from right to left. If the current digit is less than 9, simply increment it and return the array. If the digit is 9, convert it to 0 and continue (carry forward). If all digits become 0 (like 9 → 10, 99 → 100), create a new array with size +1 and set the first element as 1. #Coding #Programming #Developer #SoftwareDeveloper #Tech #CodeNewbie #100DaysOfCode #50DaysOfCode #DataStructures #Algorithms #DSA #LeetCode #CodingInterview #InterviewPreparation #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 14 of 100 Days LeetCode Challenge Problem: The K-th Lexicographical String of All Happy Strings of Length n Today’s problem is a perfect blend of Backtracking + Lexicographical Ordering 🔥 💡 Key Insight: A happy string: Uses only 'a', 'b', 'c' No two adjacent characters are the same 👉 Instead of generating all strings blindly, we: Build valid strings using backtracking Maintain lexicographical order naturally 🔍 Core Approach: 1️⃣ Backtracking (DFS) Start building string character by character At each step: Choose from 'a', 'b', 'c' Skip if same as previous character 2️⃣ Lexicographical Order Always try characters in order: 'a' → 'b' → 'c' 3️⃣ Stop Early Once we reach the k-th string, stop recursion 👉 If total strings < k → return "" 🔥 What I Learned Today: Backtracking is powerful for constraint-based generation Ordering decisions early helps avoid extra sorting Early stopping = major optimization 📈 Challenge Progress: Day 14/100 ✅ 2 weeks strong! LeetCode, Backtracking, Recursion, Lexicographical Order, Strings, DFS, DSA Practice, Coding Challenge, Problem Solving #100DaysOfCode #LeetCode #DSA #CodingChallenge #Backtracking #Recursion #Strings #ProblemSolving #TechJourney #ProgrammerLife #SoftwareDeveloper #CodingLife #LearnToCode #Developers #Consistency #GrowthMindset #InterviewPrep
To view or add a comment, sign in
-
-
💡 What vibe coding with Claude Code actually taught me: 🔄 Start fresh with each project. Not just mindset — context window. At 80% token usage, Claude starts making inconsistent decisions. New session, sharp Claude. 🧹 Don't drag old .claude configs into new projects. Global stuff (security hooks, formatting) stays global. Project stuff stays project-specific. Mixing them creates noise. ⚡ Refine your skills after each project. Most skills don't trigger because descriptions are vague. Explicit triggers matter more than detailed instructions. The real lesson: Claude Code amplifies your workflow. Good structure = faster good code. No structure = faster mess. What's working for you? Write in comments👇
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