🚀 3-Month DSA Challenge | Week 5 Data Structures & Algorithms Practice This week, I focused on strengthening problem-solving skills using: • Sliding Window • Two Pointer Technique • Hashing ✔ Implemented optimized solutions for problems including: Longest Substring Without Repeating Characters Minimum Window Substring Container With Most Water Subarrays with K Distinct Integers 📌 Key Takeaways: Converted brute force solutions into optimized O(n) approaches Improved pattern recognition for array & string problems Strengthened Java coding and logic-building skills 📈 Consistently working towards improving problem-solving ability. #DSA #Java #ProblemSolving #SoftwareDeveloper #LeetCode #GeeksforGeeks #CodingJourney
DSA Challenge Week 5: Data Structures & Algorithms Practice
More Relevant Posts
-
🔥 Day 63 of #100DaysOfCode Solved – Missing Number 🔍 What I did: Calculated the expected sum of numbers from 0 to n and subtracted the actual sum of the array to find the missing number efficiently. 💡 Key Learning: Learned how to use mathematical formula (n × (n+1) / 2) Practiced optimizing from brute force to O(n) solution Improved understanding of number patterns in arrays 🎯 Takeaway: Using mathematical insights can simplify problems and eliminate the need for extra loops or space. #Day62 #LeetCode #Java #ProblemSolving #CodingJourney #100DaysOfCode #DSA
To view or add a comment, sign in
-
-
📘 DSA Journey — Day 26 Today’s focus: Binary Search fundamentals. Problems solved: • Binary Search (LeetCode 704) • Search a 2D Matrix (LeetCode 74) Concepts used: • Binary Search • Search space reduction • Index mapping in 2D arrays Key takeaway: In Binary Search, the idea is to repeatedly divide the search space in half. By comparing the target with the middle element, we eliminate half of the array each time, achieving O(log n) time complexity. In Search a 2D Matrix, the matrix can be treated as a flattened sorted array. Using index mapping: row = mid / cols col = mid % cols we can apply binary search directly on the matrix without extra space. These problems highlight how binary search is not limited to 1D arrays—it can be extended to structured data with proper transformations. Continuing to strengthen fundamentals and consistency in DSA problem solving. #DSA #Java #LeetCode #CodingJourney
To view or add a comment, sign in
-
-
🚀 Consistency + Clarity = Progress Today I solved the Root to Leaf Paths problem on binary trees using recursion and backtracking. 🔍 Key Learnings: Understood the backtracking pattern (add → recurse → remove) Learned how to correctly identify leaf nodes Improved clarity on managing state (path list) during recursion 💡 What made the difference: Instead of memorizing, I focused on understanding the pattern — and everything clicked. 📊 Result: ✅ All test cases passed (1115/1115) ✅ 100% accuracy This is part of my ongoing journey to strengthen my Data Structures & Algorithms (DSA) fundamentals. 🎯 Takeaway: Mastering patterns like recursion and backtracking makes complex problems feel simple. #DSA #Java #Coding #ProblemSolving #Recursion #Backtracking #BinaryTree #LearningJourney #Consistency
To view or add a comment, sign in
-
-
DSA Day 11 – Prefix Sum + HashMap Pattern Today I solved the “Subarray Sum Equals K” problem on LeetCode. Problem: Given an array and an integer k, find the total number of subarrays whose sum equals k. Approach Used: -> Used Prefix Sum to keep track of cumulative sum -> Used HashMap to store frequency of prefix sums -> At each step, checked if (currentSum - k) exists in map -> If yes → added its frequency to count Time Complexity: -> O(n) Space Complexity: -> O(n) Key Learning: -> Prefix Sum helps convert subarray problems into simple calculations -> HashMap allows constant time lookup for previous sums -> Instead of checking all subarrays (O(n²)), we optimize to O(n) What I Realized: Earlier I used brute force for subarrays, but today I understood how prefix sum + hashmap eliminates nested loops completely. This pattern is powerful for many subarray problems. Thanks to Pulkit Aggarwal sir for guiding me in DSA and helping me understand problem-solving patterns. Consistency is turning into real problem-solving ability. #DSA #LeetCode #Java #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
#100DaysOfCode – Day 2 Today I worked on a DSA problem based on arrays: Check if an array is sorted and rotated 🔍 Approach: Instead of finding the exact rotation point, I focused on identifying a pattern: In a sorted and rotated array, the order should break at most once. So, I checked how many times an element is greater than the next element while traversing the array in a circular manner. ✔️ If the count of such breaks is 0 or 1 → valid ❌ If it’s more than 1 → not a sorted rotated array 🧠 Key Takeaway: This problem taught me how pattern observation can simplify logic and avoid unnecessary complexity. Sometimes the best solution is not the most obvious one! 📈 Staying consistent and improving step by step 💪 #100DaysOfCode #DSA #DataStructures #Algorithms #Java #CodingJourney #ProblemSolving #LeetCode #Consistency
To view or add a comment, sign in
-
-
#CodeEveryday — My DSA Journey | Day 2 🧩 Problem Solved: Combination Sum II (LeetCode) 💭 What I Learned: Used backtracking to generate all unique combinations whose sum equals the target. Sorted the array initially to efficiently handle duplicates and enable pruning. At each step: ✔️ Skipped duplicate elements using i > n && nums[i] == nums[i-1] ✔️ Stopped recursion early when the current element exceeded the target ✔️ Moved to the next index (i+1) to avoid reusing elements Strengthened my understanding of handling duplicates in recursion and optimizing search space. ⏱ Time Complexity: O(2ⁿ)*k (k is avg length of each combination) 🧠 Space Complexity: O(n) ⚡ Key Takeaways: ✔️ Sorting helps in both pruning and duplicate handling ✔️ Skipping duplicates is crucial for unique combinations ✔️ Backtracking becomes efficient with early stopping conditions 💻 Language Used: Java ☕ 📘 Concepts: Backtracking · Recursion · Arrays · Duplicate Handling · Pruning #CodeEveryday #DSA #LeetCode #Java #Backtracking #ProblemSolving #Algorithms #CodingJourney #Consistency 🚀
To view or add a comment, sign in
-
-
----Continuing my DSA journey---- * Problem: Parse Lisp Expression (736) * Approach: I solved this using recursion + hashmap (scope handling). I parsed the expression and evaluated it based on three cases: • add → evaluate both expressions and sum • mult → evaluate both expressions and multiply • let → assign variables and evaluate in scoped context I used a HashMap to maintain variable values and passed copies to handle nested scopes correctly. * Key Insight: The tricky part was managing variable scope in nested expressions. Each "let" creates a new scope, and variables must be resolved from inner to outer scope. * What I Learned: This problem improved my understanding of parsing complex expressions and scope management. #LeetCode #DSA #Java #Recursion #HashMap #ProblemSolving
To view or add a comment, sign in
-
-
#CodeEveryday — My DSA Journey | Day 14 🧩 Problem Solved: Search a 2D Matrix (LeetCode #74) 💭 What I Learned: Used binary search by treating the 2D matrix as a flattened sorted array. Key idea: 👉 Convert 1D index → 2D coordinates using: row = mid / number_of_columns col = mid % number_of_columns At each step: ✔️ Calculated row and column from mid ✔️ Compared matrix value with target ✔️ Adjusted search space accordingly This approach avoids nested loops and gives optimal performance. ⏱ Time Complexity: O(log (m × n)) 🧠 Space Complexity: O(1) ⚡ Key Takeaways: ✔️ 2D problems can often be reduced to 1D using indexing tricks ✔️ Binary search works whenever the data is globally sorted ✔️ Index mapping is a powerful technique in matrix problems 💻 Language Used: Java ☕ 📘 Concepts: Binary Search · Matrix · Index Mapping · Optimization #CodeEveryday #DSA #LeetCode #Java #BinarySearch #Matrix #ProblemSolving #Algorithms #CodingJourney #Consistency 🚀
To view or add a comment, sign in
-
-
🚀 DSA Preparation 💪 Solved a basic yet important Array + Two Pointer problem. Focused on rearranging elements by grouping even and odd numbers efficiently. Great for improving in-place operations and partitioning logic 🔥 🧠 Problem 🔎 Sort Array By Parity Given an integer array nums, move all even integers to the beginning followed by all odd integers. 👉 Return any array that satisfies this condition. Example Input: nums = [3,1,2,4] Output: [2,4,3,1] Input: nums = [0] Output: [0] ⚡ Key Learning 📌 Use two pointers / partition approach 📌 Efficiently rearrange elements in one pass 📌 Time Complexity: O(n) → traverse the array once 📌 Space Complexity: O(1) → in-place rearrangement (no extra space) Improving DSA with strong fundamentals 🚀 #DSA #LeetCode #Arrays #TwoPointers #Java #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
📘 DSA Journey — Day 35 Today’s focus: Binary Search with index patterns. Problem solved: • Single Element in a Sorted Array (LeetCode 540) Concepts used: • Binary Search • Index parity (even/odd pattern) • Search space reduction Key takeaway: The array is sorted and every element appears twice except one. A key observation: Before the single element, pairs start at even indices After the single element, this pattern breaks. Using binary search: • If mid is even and nums[mid] == nums[mid + 1], the single element lies on the right side • Else, it lies on the left side (including mid) By leveraging this pattern, we can find the answer in O(log n) time and O(1) space. Continuing to strengthen binary search intuition and consistency in problem solving. #DSA #Java #LeetCode #CodingJourney
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