🚀 Day 17/100 – DSA Journey Taking a slight shift from Linked Lists to string & array-based problems today ✨ 🔹 Problems Solved: 1. Find Words Containing Character 2. Length of Last Word 💡 Key Learnings: 👉 Problem 1: Find Words Containing Character Iterate through the array of words Check if each word includes the given character Store indices of matching words 👉 Key Insight: Simple traversal + condition check can solve efficiently ✅ O(n * m) Time (n = words, m = avg word length) ✅ O(k) Space (for result) 👉 Problem 2: Length of Last Word Traverse string from the end Skip trailing spaces Count characters until next space 👉 Key Insight: Reverse traversal avoids unnecessary splits ✅ O(n) Time ✅ O(1) Space 🔥 What I learned today: Not every problem needs complex data structures — sometimes clean string handling and traversal logic is enough. Switching between topics is helping me think more flexibly 🧠 Day 17 done ✅ Staying consistent! 💬 Quick question: Do you prefer solving string problems or linked list problems? #100DaysOfDSA #buildinpublic #developersoflinkedin #codinginpublic #leetcodejourney #softwareengineerlife #dailylearning #codingpractice #devcommunity #programminglife #techcareers #jobready #growthmindset
Day 17: String & Array Problems in DSA Journey
More Relevant Posts
-
🚀 Day 17/100 – DSA Journey Taking a slight shift from Linked Lists to string & array-based problems today ✨ 🔹 Problems Solved: 1. Find Words Containing Character 2. Length of Last Word 💡 Key Learnings: 👉 Problem 1: Find Words Containing Character Iterate through the array of words Check if each word includes the given character Store indices of matching words 👉 Key Insight: Simple traversal + condition check can solve efficiently ✅ O(n * m) Time (n = words, m = avg word length) ✅ O(k) Space (for result) 👉 Problem 2: Length of Last Word Traverse string from the end Skip trailing spaces Count characters until next space 👉 Key Insight: Reverse traversal avoids unnecessary splits ✅ O(n) Time ✅ O(1) Space 🔥 What I learned today: Not every problem needs complex data structures — sometimes clean string handling and traversal logic is enough. Switching between topics is helping me think more flexibly 🧠 Day 17 done ✅ Staying consistent! 💬 Quick question: Do you prefer solving string problems or linked list problems? #100DaysOfDSA #buildinpublic #developersoflinkedin #codinginpublic #leetcodejourney #softwareengineerlife #frontenddeveloper #dailylearning #codingpractice #devcommunity #programminglife #techcareers #jobready #growthmindset
To view or add a comment, sign in
-
🚀 Day 14/100 – DSA Journey Today’s problems felt closer to real-world logic building — especially handling numbers and restructuring data 🔗 🔹 Problems Solved: 1. Add Two Numbers 2. Odd Even Linked List 💡 Key Learnings: 👉 Problem 1: Add Two Numbers Traverse both linked lists simultaneously Handle carry just like manual addition Build result using a dummy node 👉 Key Insight: Even when lists are different lengths, logic remains consistent ✅ O(n) Time ✅ O(1) Space 👉 Problem 2: Odd Even Linked List Separate nodes into odd index list and even index list Maintain original order within both groups Finally connect odd list with even list 👉 Key Insight: Pure pointer manipulation, no extra space ✅ O(n) Time ✅ O(1) Space 🔥 What I learned today: Linked Lists are not about memorizing problems — they’re about mastering pointer movement and pattern recognition. Also realizing that small logic mistakes can completely break the structure 👀 Day 14 done ✅ Staying consistent! 📌 Follow my journey as I solve DSA problems daily. #100DaysOfDSA #buildinpublic #codinginpublic #developersoflinkedin #frontenddeveloper #softwareengineerlife #leetcodeproblems #dailylearning #codingpractice #techcareers #programminglife #devcommunity #growthmindset #jobready
To view or add a comment, sign in
-
🚀 Day 15/100 – DSA Journey Today was all about restructuring Linked Lists efficiently and thinking in terms of pointer movement 🔗 🔹 Problems Solved: 1. Rotate List 2. Merge Two Sorted Lists 💡 Key Learnings: 👉 Problem 1: Rotate List First, calculate the length of the list Optimize rotations using: k % length Use two pointers (fast & slow) to find new head 👉 Key Insight: Instead of rotating one by one, directly find the breaking point ✅ O(n) Time ✅ O(1) Space 👉 Problem 2: Merge Two Sorted Lists Used dummy node technique for clean implementation Compare nodes and attach smaller one 👉 Key Insight: Avoid extra space by reusing existing nodes ✅ O(n + m) Time ✅ O(1) Space 🔥 What I learned today: Most Linked List problems become easier when you: - Use dummy nodes - Think in terms of breaking & reconnecting links Also realized how small optimizations (like k % n) can save a lot of work 👀 Day 15 done ✅ Staying consistent! #100DaysOfDSA #buildinpublic #developersoflinkedin #codinginpublic #leetcodejourney #softwareengineerlife #dailylearning #codingpractice #devcommunity #programminglife #techcareers #jobready #growthmindset
To view or add a comment, sign in
-
🚀 Day 15/100 – DSA Journey Today was all about restructuring Linked Lists efficiently and thinking in terms of pointer movement 🔗 🔹 Problems Solved: 1. Rotate List 2. Merge Two Sorted Lists 💡 Key Learnings: 👉 Problem 1: Rotate List First, calculate the length of the list Optimize rotations using: k % length Use two pointers (fast & slow) to find new head 👉 Key Insight: Instead of rotating one by one, directly find the breaking point ✅ O(n) Time ✅ O(1) Space 👉 Problem 2: Merge Two Sorted Lists Used dummy node technique for clean implementation Compare nodes and attach smaller one 👉 Key Insight: Avoid extra space by reusing existing nodes ✅ O(n + m) Time ✅ O(1) Space 🔥 What I learned today: Most Linked List problems become easier when you: - Use dummy nodes - Think in terms of breaking & reconnecting links Also realized how small optimizations (like k % n) can save a lot of work 👀 Day 15 done ✅ Staying consistent! #100DaysOfDSA #buildinpublic #developersoflinkedin #codinginpublic #leetcodejourney #softwareengineerlife #frontenddeveloper #dailylearning #codingpractice #devcommunity #programminglife #techcareers #jobready #growthmindset
To view or add a comment, sign in
-
🚀 Day 20 of 100 Days LeetCode Challenge Problem: Minimum Absolute Difference in Sliding Submatrix Day 20 hits with a sliding window + sorting / data structure problem 🔥 💡 Key Insight: For every k x k submatrix, we need: 👉 Minimum absolute difference between any two distinct elements 🔍 Core Approach: 1️⃣ Slide Over All k x k Submatrices Traverse each possible top-left position (i, j) 2️⃣ Extract Elements Collect all elements inside the current submatrix 3️⃣ Sort Elements Sort the list → minimum difference will always be between adjacent elements 4️⃣ Find Minimum Difference Compute: min(arr[i] - arr[i-1]) for sorted array 👉 If all elements are same → answer = 0 💡 Optimization Thought: Instead of rebuilding every time: Use advanced structures like balanced BST / multiset Helps in efficient insert/remove while sliding 🔥 What I Learned Today: Sorting simplifies pair comparison problems Sliding window in 2D is a powerful technique Advanced data structures can optimize brute force 📈 Challenge Progress: Day 20/100 ✅ 20 Days of Consistency Completed! 🎯 LeetCode, Sliding Window, Matrix, Sorting, Data Structures, Optimization, Algorithms, DSA Practice, Problem Solving #100DaysOfCode #LeetCode #DSA #CodingChallenge #SlidingWindow #Matrix #Sorting #ProblemSolving #TechJourney #ProgrammerLife #SoftwareDeveloper #CodingLife #LearnToCode #Developers #Consistency #GrowthMindset #InterviewPrep
To view or add a comment, sign in
-
-
🚀 Day 21/100 – DSA Journey Today’s problems were all about string comparison and pattern matching 🔤 At first they looked straightforward… but handling all cases cleanly was the real challenge 👀 🔹 Problems Solved: 1. Valid Anagram 2. Longest Common Prefix 💡 Key Learnings: 👉 Problem 1: Valid Anagram Compare character frequencies of both strings If every character count matches → strings are anagrams 👉 Key Insight: Frequency counting using Map/Object makes comparison efficient ✅ O(n) Time ✅ O(1) Space (fixed alphabet size) 👉 Problem 2: Longest Common Prefix Start with the first word as prefix Compare it with remaining strings Reduce prefix until all strings match 👉 Key Insight: Gradually shrinking the prefix is simpler than generating all prefixes ✅ O(n * m) Time (m = prefix length) ✅ O(1) Extra Space 🔥 What I learned today: String problems are less about complicated algorithms and more about: choosing the right approach handling edge cases carefully writing clean logic Small optimizations and cleaner thinking are becoming more natural now ⚡ Day 21 done ✅ Still showing up every day! 💬 Quick question: Which do you prefer solving more: 🔹 String problems 🔹 Linked List problems 🔹 Array problems #100DaysOfDSA #buildinpublic #developersoflinkedin #codinginpublic #leetcodejourney #softwareengineerlife #frontenddeveloper #dailylearning #codingpractice #devcommunity #programminglife #techcareers #jobready #growthmindset
To view or add a comment, sign in
-
DSA Journey – Week 19 (Trees) This week I focused on Binary Trees, continuing with the Take U Forward roadmap. Worked on strengthening core tree concepts and solving medium-level problems using recursion and traversal patterns. What I practiced • Tree traversals (inorder, preorder, postorder) • Depth-based problems using recursion • Balanced tree checking • Diameter calculation (optimized recursion) • Maximum path sum logic • Tree comparison techniques • Level order & zig-zag traversal Approach & Thinking • Most problems follow a divide → solve → combine pattern • Recursion plays a key role: • Go left • Go right • Process current node • Optimized solutions come from calculating multiple things in one traversal • Learned to avoid repeated work → improved time complexity Key Takeaways • Trees are all about recursion + structure understanding • Writing clean recursive logic makes problems easier • Many problems look different but follow the same pattern internally Progress Mindset From confusion → clarity → pattern recognition. Still improving, but getting more comfortable with tree-based thinking. GitHub: https://lnkd.in/gdFPRvWh #DSA #Week19 #Trees #BinaryTree #Recursion #CodingJourney #TakeUForward #LearningInPublic
To view or add a comment, sign in
-
🚀 New Article Drop: Master DSA Cheat Sheet – PART 04: Linked List I’ve just published Part 04 of my DSA Cheat Sheet series, and this one covers one of the most important data structures — Linked List. In this article, I’ve explained: What a linked list actually is (with a simple train analogy) 1) How nodes are connected 2) How to insert elements step by step 3) How to delete elements safely without breaking the structure I kept the explanation simple and practical so it’s easy to understand, especially if you’re just starting with DSA. If you're preparing for coding interviews or building your fundamentals, this one will help you a lot. Give it a read and let me know your thoughts. Feedback is always welcome 🙌 #DSA #LinkedList #Coding #Programming #InterviewPrep
To view or add a comment, sign in
-
🚀 DSA Deep Dive – Day 39 Solved Edit Distance today. And this problem changed how I think about DP. 🤯 At first glance, it feels simple: Convert one string into another. But then you see the operations: • Insert • Delete • Replace And suddenly… it becomes a decision problem at every step. 👀 Here’s what I learned 👇 We define: dp[i][j] = minimum operations to convert first i characters of word1 → first j characters of word2 Now the key idea: If characters match: → No operation needed dp[i][j] = dp[i-1][j-1] If they don’t match: We have 3 choices: • Insert → dp[i][j-1] • Delete → dp[i-1][j] • Replace → dp[i-1][j-1] Take minimum of all + 1 🧠 The Real Trick Don’t think: “How to convert whole string?” Think: “How to convert smaller prefixes?” Break problem → solve subproblems → build answer. ⚙️ Complexity Time: O(n × m) Space: O(n × m) 💡 The Powerful Shift Every DP problem looks scary… Until you define the right state. Once dp[i][j] is clear, everything becomes mechanical. 🎯 Lesson DP is not about memorizing formulas. It’s about: • Defining the right state • Understanding transitions • Building from smaller answers This problem is pure DP thinking. From recursion confusion → DP clarity 🚀 Consistency continues 💪 What DP problem should I solve next? #LeetCode #DSA #DynamicProgramming #InterviewPrep #CodingJourney #ProblemSolving #100DaysOfCode #SoftwareEngineering #TechGrowth
To view or add a comment, sign in
-
-
🚀 Day 60 of my 75-Day DSA Challenge 🧠 Problem Solved: Range Sum Query 2D - Immutable 🔗 LeetCode 304 🎯 Difficulty: Medium 🏷 Topics: Array • Matrix • Prefix Sum • Design 🔍 Problem Understanding Given a 2D matrix, we need to answer multiple queries: 👉 Find sum of elements inside a rectangle (row1, col1) → (row2, col2) ✔ Multiple queries → must be efficient ✔ Brute force too slow 💡 Key Learnings ✔ 2D Prefix Sum helps reduce query time ✔ Preprocessing can optimize repeated queries ✔ Space vs Time trade-off in design problems ⚡ Approach Method (Optimal - 2D Prefix Sum): Build a prefix matrix sum[][] Each cell stores sum from (0,0) to (i,j) Use inclusion-exclusion to get result in O(1) Formula: sumRegion = sum[r2][c2] - sum[r1-1][c2] - sum[r2][c1-1] + sum[r1-1][c1-1] 🧠 Why This Works Precomputed sums allow constant-time queries Avoids recalculating overlapping regions 📊 Outcome ✅ O(1) query time achieved ✔ Stronger grip on 2D prefix sums ✔ Better understanding of optimization techniques 🔥 Progress Update Day 60 complete ✅ Consistency building momentum 🚀 On to Day 61 🔥 #75DaysOfDSA #Day60 #LeetCode #PrefixSum #Matrix #DSA #ProblemSolving #Consistency
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