Day 13/100 – Understanding Before Solving Today’s problem: Reverse String At first glance, it looks simple—but the real goal is to understand how to solve it efficiently. The challenge is to reverse the string in-place, meaning without using extra memory. Approach Explained: We use the two-pointer technique: One pointer starts from the beginning One from the end Swap characters and move inward This avoids creating a new array and keeps the solution optimal. Time Complexity: O(n) Space Complexity: O(1) Key Learning: Writing code is important, but understanding why it works is what truly builds strong problem-solving skills. One step closer to mastering DSA. #100DaysOfCode #DSA #Learning #ProblemSolving #Python #LeetCode #GrowthMindset
Reverse String in Place with Two Pointers
More Relevant Posts
-
📌 Problem: Sum of Digits in Base K 💡 Approach: Convert the given number into base k by repeatedly dividing it by k. At each step, take the remainder (n % k) which represents the digit in base k, and add it to the sum. Continue until the number becomes zero. ⚙️ Key Insight: Base conversion using division and remainder No need to explicitly store the converted number ⏱️ Time Complexity: O(logₖ n) 📦 Space Complexity: O(1) 📚 What I learned: Efficient base conversion technique Working with number systems in coding problems #LeetCode #DSA #Algorithms #Coding #ProblemSolving #Python #Math #InterviewPreparation #CodingJourney
To view or add a comment, sign in
-
🚀 Day 5 — DSA with Python Solved the classic “Product of Array Except Self” problem today. This one introduced me to an important concept: 👉 Precomputation (Prefix & Suffix Pattern) Instead of recalculating products again and again, I learned how to: • Store prefix products (left side) • Store suffix products (right side) • Combine them to get the result efficiently 💡 Key Learning: Optimizing brute-force solutions using precomputation can significantly reduce time complexity. ⚡ What challenged me: Understanding how to manage two passes (left → right and right → left) without using extra space initially felt confusing — but breaking it step by step helped. 📈 Growth Insight: DSA is less about memorizing solutions and more about recognizing patterns like this one. On to Day 6 🔥 #DSA #Python #CodingJourney #ProblemSolving #100DaysOfCode
To view or add a comment, sign in
-
-
Day 23/100 – DSA Journey Problem: Remove Duplicates from Sorted Linked List A sorted linked list keeps duplicates next to each other, which makes it easy to remove them in one pass. Used simple traversal and pointer updates to skip duplicate nodes without extra space. Key Learning: Always use the structure of the data to simplify the solution. #Day23 #100DaysOfCode #DSA #LinkedList #Python #LeetCode
To view or add a comment, sign in
-
-
DSA Tip: Queue If you process tasks in random order… you’ll run into problems. Use a Queue. It follows FIFO (First In, First Out) the first item added is the first to be removed. From print jobs to request handling, queues keep systems organized and fair. Insight: Order isn’t just important, it determines how systems behave. Quick Challenge: If you enqueue A, B, C… which comes out first? Drop your answer, I’ll review the best ones. FOLLOW FOR MORE DSA TIPS & INSIGHTS #DSA #Queue #Python #CodingTips #LearnToCode
To view or add a comment, sign in
-
-
🚀 Day 13 of #100DaysOfDSA Today’s problem was simple but powerful: 👉 Calculate x raised to the power y (x^y) using a while loop. 💡 Key Learning: How to use a loop for repeated multiplication Understanding how exponentiation works internally Strengthening logic-building with basic iteration 🧠 Approach: Initialize power = 1 Multiply x repeatedly y times Decrease y in each iteration ✅ Code (Python): x = int(input()) y = int(input()) power = 1 while y > 0: power *= x y -= 1 print(power) ⚡ Time Complexity: O(y) ⚡ Space Complexity: O(1) 📌 Small problems like this build strong fundamentals for advanced topics like recursion and fast exponentiation. Consistency is the real game 🔥 See you on Day 14! #DSA #Python #CodingJourney #WhileLoop #100DaysChallenge
To view or add a comment, sign in
-
-
Day 109 Backtracking patterns are repeating again — and that’s a good sign. #Day109 🧩 78. Subsets How today went: • Used recursion to explore all elements • At each step, decide to include or skip the current element • Append current subset → explore → then pop to backtrack • Move to the next index and repeat What I’m noticing: Subsets is one of the cleanest backtracking patterns: → choose → explore → undo Another revision day, but clarity is improving. Consistency continues. #LeetCode #DSA #Python #Backtracking #Recursion #LearningInPublic #Consistency
To view or add a comment, sign in
-
-
Day 22 of #LeetCode Challenge – Mastering Binary Search Ever searched for a word in a dictionary? You don’t check page by page… you jump to the middle. 👉 That’s exactly how Binary Search works! 💡 Problem Solved: Binary Search 🔍 Given a sorted array, find the index of a target element. ⏱️ Required Time Complexity: O(log n) ⚡ Instead of scanning every element, Binary Search cuts the search space in half every step, making it super efficient for large datasets #LeetCode #BinarySearch #DSA #CodingJourney #150DaysOfCode #Programming #Python #Tech
To view or add a comment, sign in
-
-
Every dataset deserves a gentle first look 🌿 Today I’m starting with the basics: df.head(), df.info(), and df.describe() — the quiet steps that help you understand what you’re working with. And a tiny reminder: df.describe() shows only numeric columns, while df.describe(include="all") gives a fuller picture, including text and categories 📊 Day 1 is simply about seeing the story before we start cleaning ✨ #DataMom #OneMinuteDataCleaning #LearningJourney #DataCleaning #Pandas #Python #WomenInTech #MomsInTech #SustainableGrowth
To view or add a comment, sign in
-
-
Day 102 Backtracking patterns are starting to repeat. #Day102 🧩 90. Subsets II How today went: • Similar to the basic Subsets problem • Key difference: handling duplicates • Sorting the array is important • While iterating, skip duplicates to avoid repeating subsets What clicked: Backtracking becomes easier when you: • Recognize the base pattern • Add constraints like duplicate handling Same structure, new rule. That’s how patterns build. #LeetCode #DSA #Python #Backtracking #Recursion #LearningInPublic #Consistency
To view or add a comment, sign in
-
-
Day 111 Backtracking is starting to feel consistent now. #Day111 🧩 39. Combination Sum How today went: • Used backtracking with index i • Two choices: → stay at i (reuse the same element) → move to i + 1 (try next element) • Track the current total • If total == target → add result • If total > target → stop that path What I realized: This problem is about: → controlling index movement → managing the running total Same pattern, different control. Revision is making it clearer. #LeetCode #DSA #Python #Backtracking #Recursion #LearningInPublic #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