📊 DSA Progress Update – Week 5 Over the past few days, I’ve been practicing array problems and improving my approach step by step. What I learned: • Starting with a brute force solution helps in understanding the problem clearly • Optimization becomes easier once the pattern is identified • Key techniques : - Two Pointers - Sliding Window - Prefix Sum - Kadane’s Algorithm Something new: Started learning Binary Search and understanding its basic approach. Plan: Continue practicing and get more comfortable with these concepts. Taking it one step at a time. #DSA #Java #LeetCode #Consistency #CodingJourney
GANESH GEMBALI’s Post
More Relevant Posts
-
DSA Practice Update Today I solved: #141 – Linked List Cycle Learned how to detect a cycle in a linked list using Floyd’s Cycle Detection Algorithm (fast and slow pointers). Understood how moving pointers at different speeds helps identify if a loop exists without using extra space. Key Learnings: • Fast and slow pointer technique • Detecting cycles efficiently in O(n) time • Solving problems with constant space complexity This problem strengthened my understanding of pointer-based approaches, which are commonly used in linked list interview questions. Continuing to stay consistent and improve problem-solving skills step by step. #DSA #LeetCode #CodingJourney #Java #SoftwareDevelopment #PlacementPreparation
To view or add a comment, sign in
-
-
🔥 DSA Challenge – Day 135/360 🚀 📌 Topic: Bit Manipulation 🧩 Problem: Check if a Number is Power of 2 Problem Statement: Given an integer n, determine whether it is a power of 2 or not. 🔍 Example: Input: n = 4 Output: true Input: n = 6 Output: false 💡 Approach: Optimized (Bit Manipulation) 1️⃣ Step 1 – If n <= 0, return false (powers of 2 are always positive) 2️⃣ Step 2 – Use bit trick: n & (n - 1) removes the lowest set bit 3️⃣ Step 3 – If result becomes 0, then only one set bit was present ✔ This avoids looping and works in constant time ⏱ Complexity: Time: O(1) Space: O(1) 📚 Key Learning: A number is a power of 2 if it has exactly one set bit in binary representation. #DSA #Java #Coding #InterviewPrep #ProblemSolving #TechJourney #135DaysOfCode #BitManipulation #LeetCode
To view or add a comment, sign in
-
-
🚀 Day 46 of My DSA Journey Today I solved a problem that looked simple but had an interesting twist — constrained swapping in strings. 🔍 Problem: Check if two strings can be made equal using swaps where the index difference is exactly 2. 💡 Key Learning: Instead of actually performing swaps, I understood that: Only specific indices can interact (0↔2 and 1↔3) This divides the string into independent groups We just need to compare characters within these groups ✨ This problem reinforced an important concept: 👉 When operations are restricted, think in terms of groups rather than brute-force simulation. #DSA #ProblemSolving #Java #CodingJourney #Consistency #LeetCode
To view or add a comment, sign in
-
-
🚀 Day 8 of #100DaysOfDSA Today’s problem: Longest Substring Without Repeating Characters 🧠 Problem Statement: Given a string, find the length of the longest substring without repeating characters. 💡 Approach: Sliding Window Technique Used two pointers (left & right) Maintained a HashSet to track characters Expanded window when unique Shrunk window when duplicate found ⚡ Key Learning: Efficient use of the sliding window helps reduce time complexity to O(n), which is crucial for optimizing string-based problems. 💻 Example: Input: "abcabcbb" Output: 3 ("abc") 🔥 This problem strengthened my understanding of: ✔️ Two-pointer technique ✔️ Hashing (Set/Map) ✔️ Optimizing brute force solutions Consistency is the key — small steps every day lead to big results 💪 #DSA #Java #CodingJourney #LeetCode #ProblemSolving #100DaysOfCode 🍁 Saidhanya Sree
To view or add a comment, sign in
-
-
🔥 DSA Challenge – Day 136/360 🚀 📌 Topic: Bit Manipulation 🧩 Problem: Number of 1 Bits (Hamming Weight) Problem Statement: Given an integer, return the number of set bits (1’s) present in its binary representation. 🔍 Example: Input: 6 Output: 2 Explanation: Binary of 6 → 110 → 2 set bits 💡 Optimized Approach (Brian Kernighan’s Algorithm): Instead of checking each bit one by one, we use a smart trick: n & (n - 1) removes the rightmost set bit in each iteration This reduces the number of operations to the number of set bits only ⚡ Time Complexity: O(k) (k = number of set bits) ⚡ Space Complexity: O(1) 🚀 Key Takeaway: Using bit manipulation can drastically optimize performance compared to brute force approaches. Always look for patterns in binary operations! #DSA #Coding #Java #BitManipulation #136DaysOfCode #LeetCode #ProblemSolving #SoftwareEngineering
To view or add a comment, sign in
-
-
🚀 DSA Journey Update: 7/75 Solved another problem today: Product of Array Except Self 💡 Key Idea: Used prefix (left) and suffix (right) products to build the answer without using division and in O(n) time. 🔍 Example: Input: [1,2,3,4] Output: [24,12,8,6] ⚡ Learning: Optimized approach using two passes Space optimization by reusing the same array Stronger understanding of prefix/suffix patterns Step by step progress… consistency matters more than speed 🔥 #DSA #Java #LeetCode #CodingJourney #100DaysOfCode #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 31/200 – DSA Journey Solved: Contains Duplicate (LeetCode) 🔍 Approach Used: - Sorted the array - Compared adjacent elements - If nums[i] == nums[i-1], duplicate exists ⚡ Complexity: - Time: O(n log n) - Space: O(1) 💡 Key Learning: Brute force approach (O(n²)) is simple but not efficient. Using sorting helps optimize the solution and reduces time complexity. 📈 Progress Insight: Learning to move from brute force to optimized solutions step by step. Consistency > Motivation #DSA #LeetCode #Java #ProblemSolving #CodingJourney #SoftwareEngineering
To view or add a comment, sign in
-
-
Day 33/160 of my DSA Journey Today I solved the Aggressive Cows problem. Key Insight: The problem is about maximizing the minimum distance, which hints at Binary Search on Answer. Instead of trying all placements, we search for the largest minimum distance that is possible. Approach: • Sorted the stalls array • Applied binary search on distance (low = 0, high = max distance) • For each mid distance, checked if we can place all cows • If possible → tried for a larger distance • Else → reduced the distance • Stored the maximum valid distance as answer Helper Function (canPlace): • Placed first cow at first stall • Placed next cows only if distance ≥ mid • Counted cows placed and checked if ≥ k Concepts reinforced: • Binary Search on Answer • Greedy placement strategy • Search space optimization Time Complexity: O(n log(maxDistance)) ⚡ Another step forward in problem solving 🚀 #Day33 #160DaysChallenge #DSA #GeeksforGeeks #LeetCode #CodingJourney #ProblemSolving #Algorithms #Java
To view or add a comment, sign in
-
-
🚀 Day 48/60 - DSA Challenge Today’s problem was about finding the minimum number of days required to make bouquets 🌸 🔍 Key Insight: Each bouquet requires k consecutive flowers, and each flower blooms on a specific day. The challenge is to determine the earliest day when we can make at least m bouquets. ⚡ Approach: First, check if it’s even possible to make the required bouquets Use Binary Search on days instead of iterating day by day For a given day, count how many bouquets can be formed If we can make enough bouquets, try for a smaller day Otherwise, increase the number of days 📈 Time Complexity: O(n log range) 📦 Space Complexity: O(1) 💡 This problem beautifully demonstrates how Binary Search isn’t just for arrays—it can be applied on answers (search space) to optimize brute-force solutions. 🔥 Another step forward in mastering DSA and problem-solving patterns! #Day48 #DSA #BinarySearch #CodingJourney #Java #ProblemSolving #LeetCode #100DaysOfCode
To view or add a comment, sign in
-
-
DSA Day 20 – Frequency Counting with Strings Today I solved the “Ransom Note” problem on LeetCode. Problem: Check whether the ransomNote string can be constructed using letters from the magazine string, where each letter can be used only once. Approach Used: -> Counted frequency of characters in ransomNote -> Counted frequency of characters in magazine -> Compared required characters with available characters -> If any required count was greater than available count → false Time Complexity: -> O(n + m) Space Complexity: -> O(1) (Only lowercase English letters / limited character set) Key Learning: -> Frequency counting works not only for arrays, but also for strings -> HashMap helps compare required vs available resources efficiently -> Always check constraints, because they can reduce space complexity What I Realized: Many string problems are actually counting problems in disguise. The better you recognize patterns, the faster you solve problems. Thanks to Pulkit Aggarwal sir for guiding me in DSA and helping me understand problem-solving patterns. Consistency continues, one problem every day. #DSA #LeetCode #Java #ProblemSolving #CodingJourney #100DaysOfCode
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